@memberjunction/actions 2.64.0 → 2.66.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/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ export * from './generic/BaseAction';
2
2
  export * from './generic/BaseActionFilter';
3
3
  export * from './generic/BaseOAuthAction';
4
4
  export * from './generic/ActionEngine';
5
- export * from './generic/ActionEntity.server';
6
5
  export * from './entity-actions/EntityActionEngine';
7
6
  export * from './entity-actions/EntityActionInvocationTypes';
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,8CAA8C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AAEvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,8CAA8C,CAAC"}
package/dist/index.js CHANGED
@@ -18,7 +18,6 @@ __exportStar(require("./generic/BaseAction"), exports);
18
18
  __exportStar(require("./generic/BaseActionFilter"), exports);
19
19
  __exportStar(require("./generic/BaseOAuthAction"), exports);
20
20
  __exportStar(require("./generic/ActionEngine"), exports);
21
- __exportStar(require("./generic/ActionEntity.server"), exports);
22
21
  __exportStar(require("./entity-actions/EntityActionEngine"), exports);
23
22
  __exportStar(require("./entity-actions/EntityActionInvocationTypes"), exports);
24
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,6DAA2C;AAC3C,4DAA0C;AAC1C,yDAAuC;AACvC,gEAA8C;AAE9C,sEAAoD;AACpD,+EAA6D"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,6DAA2C;AAC3C,4DAA0C;AAC1C,yDAAuC;AAEvC,sEAAoD;AACpD,+EAA6D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/actions",
3
- "version": "2.64.0",
3
+ "version": "2.66.0",
4
4
  "description": "Main library for MemberJunction Actions. This library is only intended to be imported on the server side.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,14 +19,14 @@
19
19
  "typescript": "^5.4.5"
20
20
  },
21
21
  "dependencies": {
22
- "@memberjunction/global": "2.64.0",
23
- "@memberjunction/core": "2.64.0",
24
- "@memberjunction/actions-base": "2.64.0",
25
- "@memberjunction/core-entities": "2.64.0",
26
- "@memberjunction/ai": "2.64.0",
27
- "@memberjunction/ai-core-plus": "2.64.0",
28
- "@memberjunction/aiengine": "2.64.0",
29
- "@memberjunction/ai-prompts": "2.64.0",
30
- "@memberjunction/doc-utils": "2.64.0"
22
+ "@memberjunction/global": "2.66.0",
23
+ "@memberjunction/core": "2.66.0",
24
+ "@memberjunction/actions-base": "2.66.0",
25
+ "@memberjunction/core-entities": "2.66.0",
26
+ "@memberjunction/ai": "2.66.0",
27
+ "@memberjunction/ai-core-plus": "2.66.0",
28
+ "@memberjunction/aiengine": "2.66.0",
29
+ "@memberjunction/ai-prompts": "2.66.0",
30
+ "@memberjunction/doc-utils": "2.66.0"
31
31
  }
32
32
  }
package/readme.md CHANGED
@@ -328,13 +328,14 @@ Abstract base class for action filters.
328
328
 
329
329
  #### ActionEntityServerEntity
330
330
 
331
- Server-side entity class for Actions with AI-powered code generation.
331
+ Server-side entity class for Actions with AI-powered code generation. This class is located in the `@memberjunction/core-entities-server` package.
332
332
 
333
333
  **Key Features:**
334
334
  - Automatic code generation from natural language prompts
335
335
  - Code validation and improvement through AI
336
336
  - Library dependency management
337
337
  - Transaction-safe save operations
338
+ - Automatic creation of action parameters and result codes from AI-generated definitions
338
339
 
339
340
  ### Types and Interfaces
340
341
 
@@ -1,73 +0,0 @@
1
- import { EntityInfo, EntitySaveOptions } from "@memberjunction/core";
2
- import { ActionEntityExtended, ActionLibrary, GeneratedCode } from "@memberjunction/actions-base";
3
- /**
4
- * Extended GeneratedCode interface to include parameters and result codes
5
- */
6
- interface GeneratedCodeExtended extends GeneratedCode {
7
- Parameters?: Array<{
8
- Name: string;
9
- Type: 'Input' | 'Output' | 'Both';
10
- ValueType: 'Scalar' | 'Simple Object' | 'BaseEntity Sub-Class' | 'Other';
11
- IsArray: boolean;
12
- IsRequired: boolean;
13
- DefaultValue: string | null;
14
- Description: string;
15
- }>;
16
- ResultCodes?: Array<{
17
- ResultCode: string;
18
- Description: string;
19
- IsSuccess: boolean;
20
- }>;
21
- }
22
- /**
23
- * Server-Only custom sub-class for Actions entity. This sub-class handles the process of auto-generation code for the Actions entity.
24
- */
25
- export declare class ActionEntityServerEntity extends ActionEntityExtended {
26
- constructor(Entity: EntityInfo);
27
- /**
28
- * Override of the base Save method to handle the pre-processing to auto generate code whenever an action's UserPrompt is modified.
29
- * This happens when a new record is created and also whenever the UserPrompt field is changed.
30
- * @param options
31
- * @returns
32
- */
33
- Save(options?: EntitySaveOptions): Promise<boolean>;
34
- protected manageLibraries(codeLibraries: ActionLibrary[], wasNewRecord: boolean): Promise<void>;
35
- protected SendMessage(message: string): void;
36
- /**
37
- * This method will generate code using a combination of the UserPrompt field as well as the overall context of how an Action gets executed. Code from the Action is later used by CodeGen to inject into
38
- * the mj_actions library for each user environment. The mj_actions library will have a class for each action and that class will have certain libraries imported at the top of the file and available for use.
39
- * That information along with a detailed amount of system prompt steering goes into the AI model in order to generate contextually appropriate and reliable code that maps to the business logic of the user
40
- */
41
- GenerateCode(maxAttempts?: number): Promise<GeneratedCodeExtended>;
42
- /**
43
- * Prepares the data context for the prompt template
44
- */
45
- protected PreparePromptData(): Promise<Record<string, any>>;
46
- /**
47
- * Loads the parent action entity if this is a child action
48
- */
49
- protected LoadParentAction(): Promise<ActionEntityExtended | null>;
50
- /**
51
- * Processes generated parameters and saves them to the database
52
- */
53
- protected ProcessGeneratedParameters(parameters: Array<any>): Promise<void>;
54
- /**
55
- * Processes generated result codes and saves them to the database
56
- */
57
- protected ProcessGeneratedResultCodes(resultCodes: Array<{
58
- ResultCode: string;
59
- Description: string;
60
- IsSuccess: boolean;
61
- }>): Promise<void>;
62
- /**
63
- * Validates the generated code
64
- */
65
- protected ValidateGeneratedCode(generatedCode: GeneratedCodeExtended, attemptsRemaining: number): Promise<GeneratedCodeExtended>;
66
- /**
67
- * Generates the libraries context for the prompt
68
- */
69
- protected GenerateLibrariesContext(): string;
70
- }
71
- export declare function LoadActionEntityServer(): void;
72
- export {};
73
- //# sourceMappingURL=ActionEntity.server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ActionEntity.server.d.ts","sourceRoot":"","sources":["../../src/generic/ActionEntity.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,UAAU,EAAE,iBAAiB,EAA+B,MAAM,sBAAsB,CAAC;AAQpI,OAAO,EAAoB,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAEpH;;GAEG;AACH,UAAU,qBAAsB,SAAQ,aAAa;IACjD,UAAU,CAAC,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;QAClC,SAAS,EAAE,QAAQ,GAAG,eAAe,GAAG,sBAAsB,GAAG,OAAO,CAAC;QACzE,OAAO,EAAE,OAAO,CA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,CAAC;IAMtI;;OAEG;IACH,SAAS,CAAC,wBAAwB,IAAI,MAAM;CAa/C;AAED,wBAAgB,sBAAsB,SAIrC"}
@@ -1,438 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.LoadActionEntityServer = exports.ActionEntityServerEntity = void 0;
13
- const core_1 = require("@memberjunction/core");
14
- const global_1 = require("@memberjunction/global");
15
- const aiengine_1 = require("@memberjunction/aiengine");
16
- const ai_prompts_1 = require("@memberjunction/ai-prompts");
17
- const ai_core_plus_1 = require("@memberjunction/ai-core-plus");
18
- const doc_utils_1 = require("@memberjunction/doc-utils");
19
- const actions_base_1 = require("@memberjunction/actions-base");
20
- /**
21
- * Server-Only custom sub-class for Actions entity. This sub-class handles the process of auto-generation code for the Actions entity.
22
- */
23
- let ActionEntityServerEntity = class ActionEntityServerEntity extends actions_base_1.ActionEntityExtended {
24
- constructor(Entity) {
25
- super(Entity); // call super
26
- const md = new core_1.Metadata();
27
- if (md.ProviderType !== 'Database')
28
- throw new Error('This class is only supported for server-side/database providers. Remove this package from your application.');
29
- }
30
- /**
31
- * Override of the base Save method to handle the pre-processing to auto generate code whenever an action's UserPrompt is modified.
32
- * This happens when a new record is created and also whenever the UserPrompt field is changed.
33
- * @param options
34
- * @returns
35
- */
36
- async Save(options) {
37
- // make sure the ActionEngine is configured
38
- await actions_base_1.ActionEngineBase.Instance.Config(false, this.ContextCurrentUser);
39
- await doc_utils_1.DocumentationEngine.Instance.Config(false, this.ContextCurrentUser);
40
- const provider = core_1.Metadata.Provider;
41
- // Start a database transaction
42
- await provider.BeginTransaction();
43
- try {
44
- let newCodeGenerated = false;
45
- let codeLibraries = [];
46
- let generatedParameters = [];
47
- let generatedResultCodes = [];
48
- if (this.Type === 'Generated' && // only generate when the type is Generated
49
- !this.CodeLocked && // only generate when the code is not locked
50
- (this.GetFieldByName('UserPrompt').Dirty || !this.IsSaved || this.ForceCodeGeneration) // only generate when the UserPrompt field is dirty or this is a new record or we are being asked to FORCE code generation
51
- ) {
52
- // UserPrompt field is dirty, or this is a new record, either way, this is the condition where we want to generate the Code.
53
- const result = await this.GenerateCode();
54
- if (result.Success) {
55
- this.Code = result.Code;
56
- this.CodeComments = result.Comments;
57
- this.CodeApprovalStatus = 'Pending'; // set to pending even if previously approved since we changed the code
58
- this.CodeApprovedAt = null; // reset the approved at date
59
- this.CodeApprovedByUserID = null; // reset the approved by user id
60
- newCodeGenerated = true; // flag for post-save processing of libraries
61
- codeLibraries = result.LibrariesUsed;
62
- // Store the generated parameters and result codes for later processing
63
- generatedParameters = result.Parameters || [];
64
- generatedResultCodes = result.ResultCodes || [];
65
- }
66
- else
67
- throw new Error(`Failed to generate code for Action ${this.Name}.`);
68
- }
69
- this.ForceCodeGeneration = false; // make sure to reset this flag every time we save, it should never live past one run of the Save method
70
- const wasNewRecord = !this.IsSaved;
71
- if (await super.Save(options)) {
72
- // Now handle all the child entities within the same transaction
73
- if (newCodeGenerated) {
74
- // Process libraries
75
- await this.manageLibraries(codeLibraries, wasNewRecord);
76
- // Process parameters
77
- if (generatedParameters.length > 0) {
78
- await this.ProcessGeneratedParameters(generatedParameters);
79
- }
80
- // Process result codes
81
- if (generatedResultCodes.length > 0) {
82
- await this.ProcessGeneratedResultCodes(generatedResultCodes);
83
- }
84
- }
85
- // Commit the transaction
86
- await provider.CommitTransaction();
87
- return true;
88
- }
89
- else {
90
- // Rollback on save failure
91
- await provider.RollbackTransaction();
92
- return false;
93
- }
94
- }
95
- catch (e) {
96
- // Rollback on any error
97
- await provider.RollbackTransaction();
98
- throw e;
99
- }
100
- }
101
- async manageLibraries(codeLibraries, wasNewRecord) {
102
- // new code was generated, we need to sync up the ActionLibraries table with the libraries used in the code for this Action
103
- // get a list of existing ActionLibrary records that match this Action
104
- const existingLibraries = [];
105
- if (!wasNewRecord) {
106
- const rv = new core_1.RunView();
107
- const libResult = await rv.RunView({
108
- EntityName: 'Action Libraries',
109
- ExtraFilter: `ActionID = '${this.ID}'`,
110
- ResultType: 'entity_object'
111
- }, this.ContextCurrentUser);
112
- if (libResult.Success && libResult.Results.length > 0) {
113
- existingLibraries.push(...libResult.Results);
114
- }
115
- }
116
- // now we need to go through the libraries we ARE currently using in the current code and make sure they are in the ActionLibraries table
117
- // and make sure nothing is in the table that we are not using
118
- const librariesToAdd = codeLibraries.filter(l => !existingLibraries.some(el => el.Library.trim().toLowerCase() === l.LibraryName.trim().toLowerCase()));
119
- const librariesToRemove = existingLibraries.filter(el => !codeLibraries.some(l => l.LibraryName.trim().toLowerCase() === el.Library.trim().toLowerCase()));
120
- const librariesToUpdate = existingLibraries.filter(el => codeLibraries.some(l => l.LibraryName.trim().toLowerCase() === el.Library.trim().toLowerCase()));
121
- const md = new core_1.Metadata();
122
- for (const lib of librariesToAdd) {
123
- const libMetadata = md.Libraries.find(l => l.Name.trim().toLowerCase() === lib.LibraryName.trim().toLowerCase());
124
- if (libMetadata) {
125
- const newLib = await md.GetEntityObject('Action Libraries', this.ContextCurrentUser);
126
- newLib.ActionID = this.ID;
127
- newLib.LibraryID = libMetadata.ID;
128
- newLib.ItemsUsed = lib.ItemsUsed.join(',');
129
- await newLib.Save();
130
- }
131
- }
132
- // now update the libraries that were already in place to ensure the ItemsUsed are up to date
133
- for (const lib of librariesToUpdate) {
134
- const newCode = codeLibraries.find(l => l.LibraryName.trim().toLowerCase() === lib.Library.trim().toLowerCase());
135
- lib.ItemsUsed = newCode.ItemsUsed.join(',');
136
- await lib.Save();
137
- }
138
- // now remove the libraries that are no longer used
139
- for (const lib of librariesToRemove) {
140
- // each lib in this array iteration is already a BaseEntity derived object
141
- await lib.Delete();
142
- }
143
- }
144
- SendMessage(message) {
145
- global_1.MJGlobal.Instance.RaiseEvent({
146
- args: { message },
147
- eventCode: 'Actions',
148
- event: global_1.MJEventType.ComponentEvent,
149
- component: this
150
- });
151
- }
152
- /**
153
- * This method will generate code using a combination of the UserPrompt field as well as the overall context of how an Action gets executed. Code from the Action is later used by CodeGen to inject into
154
- * the mj_actions library for each user environment. The mj_actions library will have a class for each action and that class will have certain libraries imported at the top of the file and available for use.
155
- * That information along with a detailed amount of system prompt steering goes into the AI model in order to generate contextually appropriate and reliable code that maps to the business logic of the user
156
- */
157
- async GenerateCode(maxAttempts = 3) {
158
- try {
159
- this.SendMessage('Generating code... ');
160
- // Ensure AIEngine is configured
161
- await aiengine_1.AIEngine.Instance.Config(false, this.ContextCurrentUser);
162
- // Load the consolidated prompt template from preloaded prompts
163
- const aiPrompt = aiengine_1.AIEngine.Instance.Prompts.find(p => p.Name === 'Generate Action Code' &&
164
- p.Category === 'Actions');
165
- if (!aiPrompt) {
166
- throw new Error('Failed to find AI prompt template: Generate Action Code in Actions category');
167
- }
168
- // Prepare prompt data
169
- const promptData = await this.PreparePromptData();
170
- // Execute the prompt using AIPromptRunner
171
- const promptRunner = new ai_prompts_1.AIPromptRunner();
172
- const params = new ai_core_plus_1.AIPromptParams();
173
- params.prompt = aiPrompt;
174
- params.data = promptData;
175
- params.contextUser = this.ContextCurrentUser;
176
- const result = await promptRunner.ExecutePrompt(params);
177
- if (result.success && result.result) {
178
- const generatedCode = {
179
- Success: true,
180
- Code: result.result.code.trim(),
181
- Comments: result.result.explanation,
182
- LibrariesUsed: result.result.libraries,
183
- Parameters: result.result.parameters,
184
- ResultCodes: result.result.resultCodes
185
- };
186
- // Validate the generated code
187
- return await this.ValidateGeneratedCode(generatedCode, maxAttempts);
188
- }
189
- else {
190
- return {
191
- Success: false,
192
- Code: '',
193
- Comments: result.errorMessage || 'Failed to generate code',
194
- LibrariesUsed: []
195
- };
196
- }
197
- }
198
- catch (e) {
199
- (0, core_1.LogError)(e);
200
- throw e;
201
- }
202
- }
203
- /**
204
- * Prepares the data context for the prompt template
205
- */
206
- async PreparePromptData() {
207
- const data = {
208
- userPrompt: this.UserPrompt,
209
- availableLibraries: this.GenerateLibrariesContext(),
210
- IsChildAction: !!this.ParentID // Template variable for conditional sections
211
- };
212
- // If this is a child action, load parent context and create ChildActionInfo
213
- if (this.ParentID) {
214
- const parentAction = await this.LoadParentAction();
215
- if (parentAction) {
216
- // Create the ChildActionInfo template variable with all parent details
217
- data.ChildActionInfo = `
218
- **Parent Action Name:** ${parentAction.Name}
219
- **Parent Description:** ${parentAction.Description || 'No description provided'}
220
-
221
- **Parent Parameters:**
222
- ${JSON.stringify(parentAction.Params.map(p => {
223
- return {
224
- Name: p.Name,
225
- Type: p.Type,
226
- ValueType: p.ValueType,
227
- IsArray: p.IsArray,
228
- IsRequired: p.IsRequired,
229
- DefaultValue: p.DefaultValue,
230
- Description: p.Description
231
- };
232
- }), null, 2)}
233
- `;
234
- // Also include the parent action object for template access
235
- data.parentAction = {
236
- Name: parentAction.Name,
237
- Description: parentAction.Description
238
- };
239
- }
240
- }
241
- return data;
242
- }
243
- /**
244
- * Loads the parent action entity if this is a child action
245
- */
246
- async LoadParentAction() {
247
- if (!this.ParentID)
248
- return null;
249
- const md = new core_1.Metadata();
250
- const parent = await md.GetEntityObject('Actions', this.ContextCurrentUser);
251
- if (await parent.Load(this.ParentID)) {
252
- return parent;
253
- }
254
- return null;
255
- }
256
- /**
257
- * Processes generated parameters and saves them to the database
258
- */
259
- async ProcessGeneratedParameters(parameters) {
260
- const md = new core_1.Metadata();
261
- try {
262
- // First, get existing parameters
263
- const rv = new core_1.RunView();
264
- const existingParams = await rv.RunView({
265
- EntityName: 'Action Params',
266
- ExtraFilter: `ActionID='${this.ID}'`,
267
- ResultType: 'entity_object'
268
- }, this.ContextCurrentUser);
269
- if (!existingParams.Success) {
270
- throw new Error(`Failed to load existing parameters: ${existingParams.ErrorMessage}`);
271
- }
272
- const existingParamsList = existingParams.Results || [];
273
- const generatedParamNames = parameters.map(p => p.Name.toLowerCase());
274
- // Find parameters to add, update, or remove
275
- const paramsToAdd = parameters.filter(p => !existingParamsList.some(ep => ep.Name.toLowerCase() === p.Name.toLowerCase()));
276
- const paramsToUpdate = existingParamsList.filter(ep => parameters.some(p => p.Name.toLowerCase() === ep.Name.toLowerCase()));
277
- const paramsToRemove = existingParamsList.filter(ep => !generatedParamNames.includes(ep.Name.toLowerCase()));
278
- // Add new parameters
279
- for (const param of paramsToAdd) {
280
- const newParam = await md.GetEntityObject('Action Params', this.ContextCurrentUser);
281
- newParam.ActionID = this.ID;
282
- newParam.Name = param.Name;
283
- const t = param.Type;
284
- if (t === 'Input' || t === 'Output' || t === 'Both') {
285
- newParam.Type = t;
286
- }
287
- else {
288
- newParam.Type = 'Input'; // Default to Input if type is not recognized and emit a warning
289
- console.warn(`Action Generator: Unrecognized parameter type "${t}" for parameter "${param.Name}". Defaulting to "Input".`);
290
- }
291
- newParam.ValueType = param.ValueType;
292
- newParam.IsArray = param.IsArray;
293
- newParam.IsRequired = param.IsRequired;
294
- newParam.DefaultValue = param.DefaultValue;
295
- newParam.Description = param.Description;
296
- await newParam.Save();
297
- }
298
- // Update existing parameters if properties changed
299
- for (const existingParam of paramsToUpdate) {
300
- const generatedParam = parameters.find(p => p.Name.toLowerCase() === existingParam.Name.toLowerCase());
301
- if (generatedParam) {
302
- let hasChanges = false;
303
- // Check each property for changes
304
- if (existingParam.Type !== generatedParam.Type) {
305
- existingParam.Type = generatedParam.Type;
306
- hasChanges = true;
307
- }
308
- if (existingParam.ValueType !== generatedParam.ValueType) {
309
- existingParam.ValueType = generatedParam.ValueType;
310
- hasChanges = true;
311
- }
312
- if (existingParam.IsArray !== generatedParam.IsArray) {
313
- existingParam.IsArray = generatedParam.IsArray;
314
- hasChanges = true;
315
- }
316
- if (existingParam.IsRequired !== generatedParam.IsRequired) {
317
- existingParam.IsRequired = generatedParam.IsRequired;
318
- hasChanges = true;
319
- }
320
- if (existingParam.DefaultValue !== generatedParam.DefaultValue) {
321
- existingParam.DefaultValue = generatedParam.DefaultValue;
322
- hasChanges = true;
323
- }
324
- if (existingParam.Description !== generatedParam.Description) {
325
- existingParam.Description = generatedParam.Description;
326
- hasChanges = true;
327
- }
328
- if (hasChanges) {
329
- await existingParam.Save();
330
- }
331
- }
332
- }
333
- // Remove parameters that are no longer in the generated list
334
- for (const paramToRemove of paramsToRemove) {
335
- await paramToRemove.Delete();
336
- }
337
- }
338
- catch (e) {
339
- (0, core_1.LogError)('Failed to save generated parameters:', e);
340
- throw e; // Re-throw since we're in a transaction
341
- }
342
- }
343
- /**
344
- * Processes generated result codes and saves them to the database
345
- */
346
- async ProcessGeneratedResultCodes(resultCodes) {
347
- const md = new core_1.Metadata();
348
- try {
349
- // First, get existing result codes
350
- const rv = new core_1.RunView();
351
- const existingCodes = await rv.RunView({
352
- EntityName: 'Action Result Codes',
353
- ExtraFilter: `ActionID='${this.ID}'`,
354
- ResultType: 'entity_object'
355
- }, this.ContextCurrentUser);
356
- if (!existingCodes.Success) {
357
- throw new Error(`Failed to load existing result codes: ${existingCodes.ErrorMessage}`);
358
- }
359
- const existingCodesList = existingCodes.Results || [];
360
- const generatedCodeNames = resultCodes.map(rc => rc.ResultCode.toLowerCase());
361
- // Find result codes to add, update, or remove
362
- const codesToAdd = resultCodes.filter(rc => !existingCodesList.some(ec => ec.ResultCode.toLowerCase() === rc.ResultCode.toLowerCase()));
363
- const codesToUpdate = existingCodesList.filter(ec => resultCodes.some(rc => rc.ResultCode.toLowerCase() === ec.ResultCode.toLowerCase()));
364
- const codesToRemove = existingCodesList.filter(ec => !generatedCodeNames.includes(ec.ResultCode.toLowerCase()));
365
- // Add new result codes
366
- for (const resultCode of codesToAdd) {
367
- const newCode = await md.GetEntityObject('Action Result Codes', this.ContextCurrentUser);
368
- newCode.ActionID = this.ID;
369
- newCode.ResultCode = resultCode.ResultCode;
370
- newCode.Description = resultCode.Description;
371
- newCode.IsSuccess = resultCode.IsSuccess;
372
- await newCode.Save();
373
- }
374
- // Update existing result codes if properties changed
375
- for (const existingCode of codesToUpdate) {
376
- const generatedCode = resultCodes.find(rc => rc.ResultCode.toLowerCase() === existingCode.ResultCode.toLowerCase());
377
- if (generatedCode) {
378
- let hasChanges = false;
379
- // Check each property for changes
380
- if (existingCode.Description !== generatedCode.Description) {
381
- existingCode.Description = generatedCode.Description;
382
- hasChanges = true;
383
- }
384
- if (existingCode.IsSuccess !== generatedCode.IsSuccess) {
385
- existingCode.IsSuccess = generatedCode.IsSuccess;
386
- hasChanges = true;
387
- }
388
- if (hasChanges) {
389
- await existingCode.Save();
390
- }
391
- }
392
- }
393
- // Remove result codes that are no longer in the generated list
394
- for (const codeToRemove of codesToRemove) {
395
- await codeToRemove.Delete();
396
- }
397
- }
398
- catch (e) {
399
- (0, core_1.LogError)('Failed to save generated result codes:', e);
400
- throw e; // Re-throw since we're in a transaction
401
- }
402
- }
403
- /**
404
- * Validates the generated code
405
- */
406
- async ValidateGeneratedCode(generatedCode, attemptsRemaining) {
407
- // For now, return the code as-is
408
- // TODO: Implement validation logic using a separate prompt
409
- return generatedCode;
410
- }
411
- /**
412
- * Generates the libraries context for the prompt
413
- */
414
- GenerateLibrariesContext() {
415
- return doc_utils_1.DocumentationEngine.Instance.Libraries.map((library) => {
416
- return library.Items.map((item) => {
417
- return JSON.stringify({
418
- LibraryName: library.Name,
419
- ItemName: item.Name,
420
- Content: item.HTMLContent
421
- });
422
- }).join('\n');
423
- }).join('\n');
424
- }
425
- };
426
- exports.ActionEntityServerEntity = ActionEntityServerEntity;
427
- exports.ActionEntityServerEntity = ActionEntityServerEntity = __decorate([
428
- (0, global_1.RegisterClass)(core_1.BaseEntity, 'Actions') // high priority make sure this class is used ahead of other things
429
- ,
430
- __metadata("design:paramtypes", [core_1.EntityInfo])
431
- ], ActionEntityServerEntity);
432
- function LoadActionEntityServer() {
433
- // this function is used to force the class to load and register itself with the system
434
- // this is necessary because the class is not explicitly referenced in the code, it is only registered with the system
435
- // and the system will only load it when it is needed, this function forces the class to load
436
- }
437
- exports.LoadActionEntityServer = LoadActionEntityServer;
438
- //# sourceMappingURL=ActionEntity.server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ActionEntity.server.js","sourceRoot":"","sources":["../../src/generic/ActionEntity.server.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoI;AAEpI,mDAA8E;AAC9E,uDAAoD;AAEpD,2DAA4D;AAC5D,+DAA8D;AAC9D,yDAAkH;AAClH,+DAAoH;AAsBpH;;GAEG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,mCAAoB;IAC9D,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa;QAE5B,MAAM,EAAE,GAAG,IAAI,eAAQ,EAAE,CAAC;QAC1B,IAAI,EAAE,CAAC,YAAY,KAAK,UAAU;YAC9B,MAAM,IAAI,KAAK,CAAC,6GAA6G,CAAC,CAAC;IACvI,CAAC;IAGD;;;;;OAKG;IACa,KAAK,CAAC,IAAI,CAAC,OAA2B;QAClD,2CAA2C;QAC3C,MAAM,+BAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACvE,MAAM,+BAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAE1E,MAAM,QAAQ,GAAG,eAAQ,CAAC,QAAgC,CAAC;QAE3D,+BAA+B;QAC/B,MAAM,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QAElC,IAAI,CAAC;YACD,IA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