@solidstarters/solid-core 1.2.183 → 1.2.185
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/dev-grooming-docs/ozzy-prompts.txt +32 -0
- package/dist/config/iam.config.d.ts +2 -0
- package/dist/config/iam.config.d.ts.map +1 -1
- package/dist/config/iam.config.js +1 -0
- package/dist/config/iam.config.js.map +1 -1
- package/dist/interfaces.d.ts +9 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts +10 -8
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js +35 -11
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +48 -48
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +9 -2
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/computed-fields/entity/uuid-externalid-entity-computed-field-provider.service.d.ts +10 -0
- package/dist/services/computed-fields/entity/uuid-externalid-entity-computed-field-provider.service.d.ts.map +1 -0
- package/dist/services/computed-fields/entity/uuid-externalid-entity-computed-field-provider.service.js +35 -0
- package/dist/services/computed-fields/entity/uuid-externalid-entity-computed-field-provider.service.js.map +1 -0
- package/dist/services/genai/mcp-handlers/solid-add-custom-service-method-mcp-handler.service.d.ts +16 -0
- package/dist/services/genai/mcp-handlers/solid-add-custom-service-method-mcp-handler.service.d.ts.map +1 -0
- package/dist/services/genai/mcp-handlers/solid-add-custom-service-method-mcp-handler.service.js +74 -0
- package/dist/services/genai/mcp-handlers/solid-add-custom-service-method-mcp-handler.service.js.map +1 -0
- package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.d.ts +12 -0
- package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.d.ts.map +1 -0
- package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.js +41 -0
- package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.js.map +1 -0
- package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.d.ts +12 -0
- package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.d.ts.map +1 -0
- package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.js +42 -0
- package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.js.map +1 -0
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.d.ts +1 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.d.ts.map +1 -1
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.js +8 -6
- package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.js.map +1 -1
- package/dist/services/model-metadata.service.js +4 -4
- package/dist/services/model-metadata.service.js.map +1 -1
- package/dist/services/setting.service.d.ts.map +1 -1
- package/dist/services/setting.service.js +4 -2
- package/dist/services/setting.service.js.map +1 -1
- package/dist/services/solid-ts-morph.service.d.ts +5 -0
- package/dist/services/solid-ts-morph.service.d.ts.map +1 -1
- package/dist/services/solid-ts-morph.service.js +21 -0
- package/dist/services/solid-ts-morph.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +9 -1
- package/dist/solid-core.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/config/iam.config.ts +2 -1
- package/src/interfaces.ts +12 -1
- package/src/jobs/database/trigger-mcp-client-subscriber-database.service.ts +45 -10
- package/src/seeders/seed-data/solid-core-metadata.json +48 -48
- package/src/services/chatter-message.service.ts +11 -3
- package/src/services/computed-fields/entity/uuid-externalid-entity-computed-field-provider.service.ts +34 -0
- package/src/services/genai/mcp-handlers/solid-add-custom-service-method-mcp-handler.service.ts +69 -0
- package/src/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.ts +43 -0
- package/src/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.ts +44 -0
- package/src/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.ts +4 -3
- package/src/services/model-metadata.service.ts +4 -4
- package/src/services/setting.service.ts +4 -2
- package/src/services/solid-ts-morph.service.ts +37 -0
- package/src/solid-core.module.ts +12 -3
|
@@ -36,3 +36,35 @@ Can you now create a new computed field provider.
|
|
|
36
36
|
- I will add the totalGdp field to the state model after I have the computed provider TS code.
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
# Testing prompt sequence
|
|
40
|
+
|
|
41
|
+
## Create Module
|
|
42
|
+
Can you create a new module called address-master. This will be used to store address master data.
|
|
43
|
+
|
|
44
|
+
## Add Model - Country
|
|
45
|
+
Can you add a new model to the address-master module called country.
|
|
46
|
+
This will have name, description (richText), countryCode. You can assume name & countryCode to be unique. But only name will be used as a userkey.
|
|
47
|
+
Also enable audit tracking on the model and all its fields.
|
|
48
|
+
Make sure the table name is properly prefixed with the module name snake case.
|
|
49
|
+
|
|
50
|
+
## Add Model - Language
|
|
51
|
+
Can you add a new model to the address-master module called language.
|
|
52
|
+
This will have language, languageIsoCode. You can assume language to be unique.
|
|
53
|
+
Also for the languageIsoCode, can you create a field with type staticSelection add a bunch (20 odd, include at-least 7-8 indian languages also) of commonly spoken languages with their respective language codes as values.
|
|
54
|
+
Also enable audit tracking on the model and all its fields.
|
|
55
|
+
Make sure the table name is properly prefixed with the module name snake case.
|
|
56
|
+
|
|
57
|
+
## Add Model - Country Language
|
|
58
|
+
|
|
59
|
+
Can you now add a new model called CountrySpokenLanguages, this model will have 2 many-to-one fields.
|
|
60
|
+
1. country - many-to-one with the country model.
|
|
61
|
+
2. spokenLanguage - many-to-one with the language model.
|
|
62
|
+
3. spokenBy - int field storing data representing how many people speak that language.
|
|
63
|
+
Also enable audit tracking on the model and all its fields.
|
|
64
|
+
Make sure the table name is properly prefixed with the module name snake case.
|
|
65
|
+
|
|
66
|
+
## Add Model - Country Population Trend
|
|
67
|
+
Can you add a model called CountryPopulationTrend, this model has the following fields.
|
|
68
|
+
1. country - many-to-one with the country model.
|
|
69
|
+
2. entryDate - date field.
|
|
70
|
+
3. populationAsOnDate - int field storing the population of that country as on that date.
|
|
@@ -21,6 +21,7 @@ export declare const iamConfig: (() => {
|
|
|
21
21
|
};
|
|
22
22
|
iamAutoGeneratedPassword: string | boolean;
|
|
23
23
|
passwordPepper: string;
|
|
24
|
+
showNameFieldsForRegistration: boolean;
|
|
24
25
|
}) & import("@nestjs/config").ConfigFactoryKeyHost<{
|
|
25
26
|
passwordlessRegistration: boolean;
|
|
26
27
|
iamPasswordRegistrationEnabled: boolean;
|
|
@@ -44,6 +45,7 @@ export declare const iamConfig: (() => {
|
|
|
44
45
|
};
|
|
45
46
|
iamAutoGeneratedPassword: string | boolean;
|
|
46
47
|
passwordPepper: string;
|
|
48
|
+
showNameFieldsForRegistration: boolean;
|
|
47
49
|
}>;
|
|
48
50
|
export declare const jwtConfig: (() => {
|
|
49
51
|
secret: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iam.config.d.ts","sourceRoot":"","sources":["../../src/config/iam.config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"iam.config.d.ts","sourceRoot":"","sources":["../../src/config/iam.config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BpB,CAAA;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;EAQpB,CAAC"}
|
|
@@ -27,6 +27,7 @@ exports.iamConfig = (0, config_1.registerAs)('iam', () => {
|
|
|
27
27
|
},
|
|
28
28
|
iamAutoGeneratedPassword: process.env.IAM_AUTOGENERATED_PASSWORD || true,
|
|
29
29
|
passwordPepper: process.env.IAM_PASSWORD_PEPPER || '',
|
|
30
|
+
showNameFieldsForRegistration: process.env.IAM_SHOW_NAME_FIELDS_FOR_REGISTRATION === 'true' ? true : false,
|
|
30
31
|
};
|
|
31
32
|
});
|
|
32
33
|
exports.jwtConfig = (0, config_1.registerAs)('jwt', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iam.config.js","sourceRoot":"","sources":["../../src/config/iam.config.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,4BAAkC;AAErB,QAAA,SAAS,GAAG,IAAA,mBAAU,EAAC,KAAK,EAAE,GAAG,EAAE;IAC5C,OAAO;QACH,wBAAwB,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,IAAI,OAAO,CAAC,KAAK,MAAM;QAC5F,8BAA8B,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,MAAM,CAAC,KAAK,MAAM;QACpG,oCAAoC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,4CAA4C,IAAI,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACjJ,uBAAuB,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,MAAM,CAAC,KAAK,MAAM;QACzF,0BAA0B,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,MAAM,CAAC,KAAK,MAAM;QAChG,2BAA2B,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,mCAAmC,IAAI,OAAO,CAAC,KAAK,MAAM;QACpG,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC;QACvD,qCAAqC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,6CAA6C,IA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IAAI,CAAC,CAAC,CAAC,KAAK;KAC5G,CAAC;AACN,CAAC,CAAC,CAAA;AAEW,QAAA,SAAS,GAAG,IAAA,mBAAU,EAAC,KAAK,EAAE,GAAG,EAAE;IAC5C,OAAO;QACH,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;QAClC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB;QAC5C,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB;QACxC,cAAc,EAAE,QAAQ,CAAC,CAAA,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAK,OAAO,CAAC,GAAG,CAAC,GAAmB,KAAK,iBAAW,CAAC,UAAU,EAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QACpJ,eAAe,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,QAAQ,EAAE,EAAE,CAAC;KACnF,CAAC;AACN,CAAC,CAAC,CAAC","sourcesContent":["import { registerAs } from '@nestjs/config';\nimport { Environment } from 'src';\n\nexport const iamConfig = registerAs('iam', () => {\n return {\n passwordlessRegistration: (process.env.IAM_PASSWORD_LESS_REGISTRATION ?? 'false') === 'true',\n iamPasswordRegistrationEnabled: (process.env.IAM_PASSWORD_REGISTRATION_ENABLED ?? 'true') === 'true',\n passwordlessRegistrationValidateWhat: (process.env.IAM_PASSWORD_LESS_REGISTRATION_VALIDATE_WHAT ?? 'email').split(',').map((item) => item.trim()),\n allowPublicRegistration: (process.env.IAM_ALLOW_PUBLIC_REGISTRATION ?? 'true') === 'true',\n activateUserOnRegistration: (process.env.IAM_ACTIVATE_USER_ON_REGISTRATION ?? 'true') === 'true',\n autoLoginUserOnRegistration: (process.env.IAM_AUTO_LOGIN_USER_ON_REGISTRATION ?? 'false') === 'true',\n otpExpiry: parseInt(process.env.IAM_OTP_EXPIRY ?? '10'),\n forgotPasswordVerificationTokenExpiry: parseInt(process.env.IAM_FORGOT_PASSWORD_VERIFICATION_TOKEN_EXPIRY ?? '10'),\n defaultRole: process.env.IAM_DEFAULT_ROLE ?? 'Public',\n dummyOtp: process.env.IAM_OTP_DUMMY,\n forgotPasswordSendVerificationTokenOn: process.env.IAM_FORGOT_PASSWORD_SEND_VERIFICATION_TOKEN_ON ?? 'email',\n forceChangePasswordOnFirstLogin:true,\n PASSWORD_REGEX: process.env.PASSWORD_REGEX || '^$|^(?=.*[a-z])(?=.*[A-Z])(?=.*\\\\d)(?=.*[^\\\\da-zA-Z]).*$',\n PASSWORD_COMPLEXITY_DESC : process.env.PASSWORD_COMPLEXITY_DESC || 'Password must contain at least one uppercase, one lowercase, one number, and one special character.',\n googleOauth: {\n clientID: process.env.IAM_GOOGLE_OAUTH_CLIENT_ID,\n clientSecret: process.env.IAM_GOOGLE_OAUTH_CLIENT_SECRET,\n callbackURL: process.env.IAM_GOOGLE_OAUTH_CALLBACK_URL,\n redirectURL: process.env.IAM_GOOGLE_OAUTH_REDIRECT_URL,\n },\n iamAutoGeneratedPassword:process.env.IAM_AUTOGENERATED_PASSWORD || true,\n passwordPepper: process.env.IAM_PASSWORD_PEPPER || '', // Adding a pepper to the password hashing process for extra security,\n showNameFieldsForRegistration:process.env.IAM_SHOW_NAME_FIELDS_FOR_REGISTRATION === 'true' ? true : false,\n };\n})\n\nexport const jwtConfig = registerAs('jwt', () => {\n return {\n secret: process.env.IAM_JWT_SECRET,\n audience: process.env.IAM_JWT_TOKEN_AUDIENCE,\n issuer: process.env.IAM_JWT_TOKEN_ISSUER,\n accessTokenTtl: parseInt(process.env.IAM_JWT_ACCESS_TOKEN_TTL ?? (process.env.ENV as Environment) === Environment.Production ? '1200' : '86400', 10), // 20 minutes in prod, 1 day otherwise\n refreshTokenTtl: parseInt(process.env.IAM_JWT_REFRESH_TOKEN_TTL ?? '604800', 10), // 7 days\n };\n});\n"]}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -166,7 +166,7 @@ export interface IErrorCodeProvider {
|
|
|
166
166
|
rules(): ReadonlyArray<ErrorRule>;
|
|
167
167
|
resolve?(code: ErrorCode): ErrorMeta | undefined;
|
|
168
168
|
}
|
|
169
|
-
export type PlanStep = CreateNewFileStep | RegisterNestProviderStep;
|
|
169
|
+
export type PlanStep = CreateNewFileStep | RegisterNestProviderStep | AddMethodToExistingClassStep;
|
|
170
170
|
export interface CreateNewFileStep {
|
|
171
171
|
type: "createNewFile";
|
|
172
172
|
path: string;
|
|
@@ -183,6 +183,14 @@ export interface RegisterNestProviderStep {
|
|
|
183
183
|
uniqueGuard?: boolean;
|
|
184
184
|
rationale?: string;
|
|
185
185
|
}
|
|
186
|
+
export interface AddMethodToExistingClassStep {
|
|
187
|
+
type: "addMethodToExistingClass";
|
|
188
|
+
path: string;
|
|
189
|
+
className: string;
|
|
190
|
+
methodName: string;
|
|
191
|
+
content: string;
|
|
192
|
+
rationale?: string;
|
|
193
|
+
}
|
|
186
194
|
export interface McpComputedProviderResponse {
|
|
187
195
|
plan: PlanStep[];
|
|
188
196
|
}
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC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AAW,iBAAiB;IAChC,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,0BAA0B,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,QAAQ,EAAE,CAAC;CAElB"}
|
package/dist/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;AAuJA,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,gDAAmC,CAAA;AACrC,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB;AAED,MAAa,YAAY;IACvB,YACS,IAAS,EACT,OAAU;QADV,SAAI,GAAJ,IAAI,CAAK;QACT,YAAO,GAAP,OAAO,CAAG;IACf,CAAC;CACN;AALD,oCAKC;AAmED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;AACvB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB","sourcesContent":["import { CreateEmailTemplateDto } from 'src/dtos/create-email-template.dto';\nimport { CreateSmsTemplateDto } from 'src/dtos/create-sms-template.dto';\nimport { SignUpDto } from 'src/dtos/sign-up.dto';\nimport { Readable } from 'stream';\nimport { CreateMediaStorageProviderMetadataDto } from './dtos/create-media-storage-provider-metadata.dto';\nimport { DatasourceType } from './dtos/create-model-metadata.dto';\nimport { CreateModuleMetadataDto } from './dtos/create-module-metadata.dto';\nimport { CreateRoleMetadataDto } from './dtos/create-role-metadata.dto';\nimport { CreateSecurityRuleDto } from './dtos/create-security-rule.dto';\nimport { FieldMetadata } from './entities/field-metadata.entity';\nimport { Media } from './entities/media.entity';\nimport { DashboardQuestion } from './entities/dashboard-question.entity';\nimport { ComputedFieldMetadata } from './helpers/solid-registry';\nimport { SqlExpression } from './services/question-data-providers/chartjs-sql-data-provider.service';\nimport { CreateDashboardDto } from './dtos/create-dashboard.dto';\nimport { AiInteraction } from './entities/ai-interaction.entity';\n\nexport interface FieldCrudManager {\n // fieldMetadata: FieldMetadata;\n // entityManager?: EntityManager;\n // createDto: any;\n // files : Array<Express.Multer.File>;\n validate(\n dto: any,\n files: Array<Express.Multer.File>,\n ): ValidationError[] | Promise<ValidationError[]>;\n transformForCreate(dto: any, ctxt?: any): any | Promise<any>;\n}\n\nexport interface ValidationError {\n field: string;\n error: string;\n}\n\n// export interface MediaStorage\nexport interface MediaStorageProvider<T> {\n store(files: Express.Multer.File[], entity: T, mediaFieldMetadata: FieldMetadata): Promise<Media[]>;\n delete(entity: T, mediaFieldMetadata: FieldMetadata): Promise<void>;\n retrieve(entity: T, mediaFieldMetadata: FieldMetadata): Promise<Media[]>;\n storeStreams(streamPairs: [Readable, string][], entity: T, mediaFieldMetadata: FieldMetadata): Promise<Media[]>;\n // delete(file: string): Promise<void>;\n}\n\nexport interface ModuleMetadataConfiguration {\n moduleMetadata?: CreateModuleMetadataDto,\n roles?: CreateRoleMetadataDto[],\n users?: SignUpDto[],\n actions?: any[],\n menus?: any[],\n views?: any[],\n emailTemplates?: CreateEmailTemplateDto[],\n smsTemplates?: CreateSmsTemplateDto[],\n mediaStorageProviders?: CreateMediaStorageProviderMetadataDto[]\n securityRules?: CreateSecurityRuleDto[],\n dashboards?: CreateDashboardDto[],\n}\n\nexport interface CodeGenerationOptions {\n moduleId?: number;\n moduleUserKey?: string;\n modelId?: number;\n modelUserKey?: string;\n fieldIdsForRemoval?: number[];\n dryRun?: boolean;\n}\n\nexport interface TriggerMcpClientOptions {\n aiInteractionId: number;\n moduleName: string;\n}\n\nexport interface McpResponse {\n success: boolean;\n request: string;\n response: string;\n model?: string;\n tools_invoked?: string[];\n tool_calls?: any[];\n duration_ms?: number;\n errors?: string[];\n error_trace?: string[];\n content_type?: string;\n}\n\nexport interface ISelectionProviderContext {\n // query: string;\n}\n\nexport interface ISelectionProviderValues {\n label: string;\n value: string;\n}\n\nexport interface ISelectionProvider<T extends ISelectionProviderContext> {\n help(): string;\n\n name(): string;\n\n value(optionValue: string, ctxt: T): Promise<ISelectionProviderValues | any>;\n\n values(query: any, ctxt: T): Promise<readonly ISelectionProviderValues[]>;\n}\n\nexport interface IDashboardVariableSelectionProvider<T extends ISelectionProviderContext> extends ISelectionProvider<T> {\n}\n\nexport interface IMcpToolResponseHandler {\n apply(aiInteraction: AiInteraction);\n}\n\nexport interface IDashboardQuestionDataProvider<TContext, TData> {\n help(): string;\n\n name(): string;\n\n getData(question: DashboardQuestion, expressions?: SqlExpression[], ctxt?: TContext): Promise<TData[] | TData>;\n}\n\n/**\n * @deprecated Use `IEntityComputedFieldProvider` instead.\n */\nexport interface IComputedFieldProvider<T> {\n help(): string;\n\n name(): string;\n\n valueType(): string;\n\n computeValue(dto: any, ctxt: T): Promise<string | number>; // FIXME : Improve the types to make it more specific using generics\n}\n\nexport interface IEntityComputedFieldProvider {\n help(): string;\n\n name(): string;\n}\n\nexport interface IEntityPreComputeFieldProvider<TTriggerEntity, TContext, TValue = void> extends IEntityComputedFieldProvider {\n preComputeValue(triggerEntity: TTriggerEntity, computedFieldMetadata: ComputedFieldMetadata<TContext>): Promise<TValue>;\n}\n\nexport interface IEntityPostComputeFieldProvider<TTriggerEntity, TContext> extends IEntityComputedFieldProvider {\n postComputeAndSaveValue(triggerEntity: TTriggerEntity, computedFieldMetadata: ComputedFieldMetadata<TContext>): Promise<void>;\n}\n\nexport interface ISolidDatabaseModule {\n name(): string;\n\n type(): DatasourceType;\n}\n\nexport enum EventType {\n USER_REGISTERED = 'user.registered',\n}\n\nexport class EventDetails<T> {\n constructor(\n public type: any,\n public payload: T,\n ) { }\n}\n\nexport interface IMail<TResponse = unknown> {\n sendEmail(\n to: string,\n subject: string,\n body: string,\n shouldQueueEmails: boolean,\n wrapperAttachments?: MailAttachmentWrapper[],\n attachments?: MailAttachment[],\n parentEntity?: any,\n parentEntityId?: any,\n cc?: string[],\n bcc?: string[],\n from?: string,\n ): Promise<TResponse>;\n\n sendEmailUsingTemplate(\n to: string,\n templateName: string,\n templateParams: any,\n shouldQueueEmails: boolean,\n wrapperAttachments?: MailAttachmentWrapper[],\n attachments?: MailAttachment[],\n parentEntity?: any,\n parentEntityId?: any,\n cc?: string[],\n bcc?: string[],\n from?: string,\n ): Promise<TResponse>;\n}\n\nexport interface ISMS {\n sendSMS(to: string, body: string, shouldQueueSms: boolean): Promise<any>;\n\n sendSMSUsingTemplate(\n to: string,\n templateName: string,\n templateParams: any,\n shouldQueueSms: boolean,\n ): Promise<any>;\n}\n\nexport interface IWhatsAppTransport {\n sendWhatsAppMessage(\n to: string,\n templateId: string,\n parameters: any,\n parentEntity?: any,\n parentEntityId?: any\n ): Promise<any>;\n}\n\nexport interface MailAttachmentWrapper {\n relativePath?: string;\n attachment?: MailAttachment;\n}\n\nexport interface MailAttachment {\n filename: string;\n templatePath?: string; // deprecated\n templateParams?: any; // deprecated\n content?: string | Buffer;\n contentType?: string;\n path?: string; //Filesystem absolute path or URL. \n}\n\nexport enum BrokerType {\n RabbitMQ = 'rabbitmq',\n Database = 'database'\n}\n\nexport interface QueuesModuleOptions {\n name: string;\n type: BrokerType;\n queueName: string;\n}\n\nexport type MediaWithFullUrl = Media & {\n _full_url: string;\n};\n\n\nexport type ErrorCode = string;\n\nexport type ErrorMeta = {\n message: string;\n httpStatus?: number;\n};\n\nexport type ErrorRule = {\n /** Canonical error code. Keep them kebab-case for consistency. */\n code: ErrorCode;\n /** Higher runs earlier. Defaults to 0 if not provided. */\n priority?: number;\n /** Return true if this rule matches the combined error text. */\n match: (combinedErrorText: string) => boolean;\n /** Display + HTTP mapping for this code. */\n meta: ErrorMeta;\n};\n\nexport interface IErrorCodeProvider {\n /** Used for registry identity & logs */\n name(): string;\n\n /**\n * Return all rules this provider contributes.\n * These will be merged with other providers’ rules, then sorted by priority.\n */\n rules(): ReadonlyArray<ErrorRule>;\n\n /**\n * Optional fallback meta for codes this provider owns (when called by getMessage/getHttpStatus).\n * If omitted, the ErrorMapperService will rely on the rule.meta of the first matching rule.\n */\n resolve?(code: ErrorCode): ErrorMeta | undefined;\n}\n\n// MCP Tool Related\n\nexport type PlanStep = CreateNewFileStep | RegisterNestProviderStep;\n\nexport interface CreateNewFileStep {\n type: \"createNewFile\";\n path: string; // repo-relative e.g. solid-api/api/src/computed-providers/foo.provider.ts\n content: string; // full file content\n overwrite?: boolean; // default=false\n rationale?: string; // optional, ignored by executor\n}\n\nexport interface RegisterNestProviderStep {\n type: \"registerNestProvider\";\n modulePath: string; // e.g. apps/api/src/address-master/address-master.module.ts\n providerClassName: string; // e.g. StateTotalCitiesComputedFieldProvider\n importFrom: string; // e.g. \"@/computed-providers/state-total-cities.provider\"\n registerIn: Array<\"providers\" | \"exports\">; // which arrays to add to\n uniqueGuard?: boolean; // default=true\n rationale?: string; // optional, ignored by executor\n}\n\nexport interface McpComputedProviderResponse {\n plan: PlanStep[];\n // provider?: any; // (intentionally ignored per your note)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;AAuJA,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,gDAAmC,CAAA;AACrC,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB;AAED,MAAa,YAAY;IACvB,YACS,IAAS,EACT,OAAU;QADV,SAAI,GAAJ,IAAI,CAAK;QACT,YAAO,GAAP,OAAO,CAAG;IACf,CAAC;CACN;AALD,oCAKC;AAmED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;AACvB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB","sourcesContent":["import { CreateEmailTemplateDto } from 'src/dtos/create-email-template.dto';\nimport { CreateSmsTemplateDto } from 'src/dtos/create-sms-template.dto';\nimport { SignUpDto } from 'src/dtos/sign-up.dto';\nimport { Readable } from 'stream';\nimport { CreateMediaStorageProviderMetadataDto } from './dtos/create-media-storage-provider-metadata.dto';\nimport { DatasourceType } from './dtos/create-model-metadata.dto';\nimport { CreateModuleMetadataDto } from './dtos/create-module-metadata.dto';\nimport { CreateRoleMetadataDto } from './dtos/create-role-metadata.dto';\nimport { CreateSecurityRuleDto } from './dtos/create-security-rule.dto';\nimport { FieldMetadata } from './entities/field-metadata.entity';\nimport { Media } from './entities/media.entity';\nimport { DashboardQuestion } from './entities/dashboard-question.entity';\nimport { ComputedFieldMetadata } from './helpers/solid-registry';\nimport { SqlExpression } from './services/question-data-providers/chartjs-sql-data-provider.service';\nimport { CreateDashboardDto } from './dtos/create-dashboard.dto';\nimport { AiInteraction } from './entities/ai-interaction.entity';\n\nexport interface FieldCrudManager {\n // fieldMetadata: FieldMetadata;\n // entityManager?: EntityManager;\n // createDto: any;\n // files : Array<Express.Multer.File>;\n validate(\n dto: any,\n files: Array<Express.Multer.File>,\n ): ValidationError[] | Promise<ValidationError[]>;\n transformForCreate(dto: any, ctxt?: any): any | Promise<any>;\n}\n\nexport interface ValidationError {\n field: string;\n error: string;\n}\n\n// export interface MediaStorage\nexport interface MediaStorageProvider<T> {\n store(files: Express.Multer.File[], entity: T, mediaFieldMetadata: FieldMetadata): Promise<Media[]>;\n delete(entity: T, mediaFieldMetadata: FieldMetadata): Promise<void>;\n retrieve(entity: T, mediaFieldMetadata: FieldMetadata): Promise<Media[]>;\n storeStreams(streamPairs: [Readable, string][], entity: T, mediaFieldMetadata: FieldMetadata): Promise<Media[]>;\n // delete(file: string): Promise<void>;\n}\n\nexport interface ModuleMetadataConfiguration {\n moduleMetadata?: CreateModuleMetadataDto,\n roles?: CreateRoleMetadataDto[],\n users?: SignUpDto[],\n actions?: any[],\n menus?: any[],\n views?: any[],\n emailTemplates?: CreateEmailTemplateDto[],\n smsTemplates?: CreateSmsTemplateDto[],\n mediaStorageProviders?: CreateMediaStorageProviderMetadataDto[]\n securityRules?: CreateSecurityRuleDto[],\n dashboards?: CreateDashboardDto[],\n}\n\nexport interface CodeGenerationOptions {\n moduleId?: number;\n moduleUserKey?: string;\n modelId?: number;\n modelUserKey?: string;\n fieldIdsForRemoval?: number[];\n dryRun?: boolean;\n}\n\nexport interface TriggerMcpClientOptions {\n aiInteractionId: number;\n moduleName: string;\n}\n\nexport interface McpResponse {\n success: boolean;\n request: string;\n response: string;\n model?: string;\n tools_invoked?: string[];\n tool_calls?: any[];\n duration_ms?: number;\n errors?: string[];\n error_trace?: string[];\n content_type?: string;\n}\n\nexport interface ISelectionProviderContext {\n // query: string;\n}\n\nexport interface ISelectionProviderValues {\n label: string;\n value: string;\n}\n\nexport interface ISelectionProvider<T extends ISelectionProviderContext> {\n help(): string;\n\n name(): string;\n\n value(optionValue: string, ctxt: T): Promise<ISelectionProviderValues | any>;\n\n values(query: any, ctxt: T): Promise<readonly ISelectionProviderValues[]>;\n}\n\nexport interface IDashboardVariableSelectionProvider<T extends ISelectionProviderContext> extends ISelectionProvider<T> {\n}\n\nexport interface IMcpToolResponseHandler {\n apply(aiInteraction: AiInteraction);\n}\n\nexport interface IDashboardQuestionDataProvider<TContext, TData> {\n help(): string;\n\n name(): string;\n\n getData(question: DashboardQuestion, expressions?: SqlExpression[], ctxt?: TContext): Promise<TData[] | TData>;\n}\n\n/**\n * @deprecated Use `IEntityComputedFieldProvider` instead.\n */\nexport interface IComputedFieldProvider<T> {\n help(): string;\n\n name(): string;\n\n valueType(): string;\n\n computeValue(dto: any, ctxt: T): Promise<string | number>; // FIXME : Improve the types to make it more specific using generics\n}\n\nexport interface IEntityComputedFieldProvider {\n help(): string;\n\n name(): string;\n}\n\nexport interface IEntityPreComputeFieldProvider<TTriggerEntity, TContext, TValue = void> extends IEntityComputedFieldProvider {\n preComputeValue(triggerEntity: TTriggerEntity, computedFieldMetadata: ComputedFieldMetadata<TContext>): Promise<TValue>;\n}\n\nexport interface IEntityPostComputeFieldProvider<TTriggerEntity, TContext> extends IEntityComputedFieldProvider {\n postComputeAndSaveValue(triggerEntity: TTriggerEntity, computedFieldMetadata: ComputedFieldMetadata<TContext>): Promise<void>;\n}\n\nexport interface ISolidDatabaseModule {\n name(): string;\n\n type(): DatasourceType;\n}\n\nexport enum EventType {\n USER_REGISTERED = 'user.registered',\n}\n\nexport class EventDetails<T> {\n constructor(\n public type: any,\n public payload: T,\n ) { }\n}\n\nexport interface IMail<TResponse = unknown> {\n sendEmail(\n to: string,\n subject: string,\n body: string,\n shouldQueueEmails: boolean,\n wrapperAttachments?: MailAttachmentWrapper[],\n attachments?: MailAttachment[],\n parentEntity?: any,\n parentEntityId?: any,\n cc?: string[],\n bcc?: string[],\n from?: string,\n ): Promise<TResponse>;\n\n sendEmailUsingTemplate(\n to: string,\n templateName: string,\n templateParams: any,\n shouldQueueEmails: boolean,\n wrapperAttachments?: MailAttachmentWrapper[],\n attachments?: MailAttachment[],\n parentEntity?: any,\n parentEntityId?: any,\n cc?: string[],\n bcc?: string[],\n from?: string,\n ): Promise<TResponse>;\n}\n\nexport interface ISMS {\n sendSMS(to: string, body: string, shouldQueueSms: boolean): Promise<any>;\n\n sendSMSUsingTemplate(\n to: string,\n templateName: string,\n templateParams: any,\n shouldQueueSms: boolean,\n ): Promise<any>;\n}\n\nexport interface IWhatsAppTransport {\n sendWhatsAppMessage(\n to: string,\n templateId: string,\n parameters: any,\n parentEntity?: any,\n parentEntityId?: any\n ): Promise<any>;\n}\n\nexport interface MailAttachmentWrapper {\n relativePath?: string;\n attachment?: MailAttachment;\n}\n\nexport interface MailAttachment {\n filename: string;\n templatePath?: string; // deprecated\n templateParams?: any; // deprecated\n content?: string | Buffer;\n contentType?: string;\n path?: string; //Filesystem absolute path or URL. \n}\n\nexport enum BrokerType {\n RabbitMQ = 'rabbitmq',\n Database = 'database'\n}\n\nexport interface QueuesModuleOptions {\n name: string;\n type: BrokerType;\n queueName: string;\n}\n\nexport type MediaWithFullUrl = Media & {\n _full_url: string;\n};\n\n\nexport type ErrorCode = string;\n\nexport type ErrorMeta = {\n message: string;\n httpStatus?: number;\n};\n\nexport type ErrorRule = {\n /** Canonical error code. Keep them kebab-case for consistency. */\n code: ErrorCode;\n /** Higher runs earlier. Defaults to 0 if not provided. */\n priority?: number;\n /** Return true if this rule matches the combined error text. */\n match: (combinedErrorText: string) => boolean;\n /** Display + HTTP mapping for this code. */\n meta: ErrorMeta;\n};\n\nexport interface IErrorCodeProvider {\n /** Used for registry identity & logs */\n name(): string;\n\n /**\n * Return all rules this provider contributes.\n * These will be merged with other providers’ rules, then sorted by priority.\n */\n rules(): ReadonlyArray<ErrorRule>;\n\n /**\n * Optional fallback meta for codes this provider owns (when called by getMessage/getHttpStatus).\n * If omitted, the ErrorMapperService will rely on the rule.meta of the first matching rule.\n */\n resolve?(code: ErrorCode): ErrorMeta | undefined;\n}\n\n// MCP Tool Related\n\nexport type PlanStep = CreateNewFileStep | RegisterNestProviderStep | AddMethodToExistingClassStep;\n\nexport interface CreateNewFileStep {\n type: \"createNewFile\";\n path: string; // repo-relative e.g. solid-api/api/src/computed-providers/foo.provider.ts\n content: string; // full file content\n overwrite?: boolean; // default=false\n rationale?: string; // optional, ignored by executor\n}\n\nexport interface RegisterNestProviderStep {\n type: \"registerNestProvider\";\n modulePath: string; // e.g. apps/api/src/address-master/address-master.module.ts\n providerClassName: string; // e.g. StateTotalCitiesComputedFieldProvider\n importFrom: string; // e.g. \"@/computed-providers/state-total-cities.provider\"\n registerIn: Array<\"providers\" | \"exports\">; // which arrays to add to\n uniqueGuard?: boolean; // default=true\n rationale?: string; // optional, ignored by executor\n}\n\nexport interface AddMethodToExistingClassStep {\n type: \"addMethodToExistingClass\";\n path: string; // e.g. apps/api/src/address-master/services/address-master.service.ts\n className: string // e.g. CountryService\n methodName: string // e.g. addCountry\n content: string // Full Method Code\n rationale?: string; // optional, ignored by executor\n}\n\n\n\nexport interface McpComputedProviderResponse {\n plan: PlanStep[];\n // provider?: any; // (intentionally ignored per your note)\n}\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { ModelMetadataService } from 'src';
|
|
2
|
+
import { SolidRegistry } from 'src/helpers/solid-registry';
|
|
1
3
|
import { QueueMessage } from 'src/interfaces/mq';
|
|
2
|
-
import {
|
|
3
|
-
import { MqMessageQueueService } from '../../services/mq-message-queue.service';
|
|
4
|
-
import { McpResponse, QueuesModuleOptions, TriggerMcpClientOptions } from "../../interfaces";
|
|
5
|
-
import { DatabaseSubscriber } from 'src/services/queues/database-subscriber.service';
|
|
4
|
+
import { DashboardRepository } from 'src/repository/dashboard.repository';
|
|
6
5
|
import { AiInteractionService } from 'src/services/ai-interaction.service';
|
|
7
|
-
import { PollerService } from 'src/services/poller.service';
|
|
8
|
-
import { SolidRegistry } from 'src/helpers/solid-registry';
|
|
9
6
|
import { ModuleMetadataService } from 'src/services/module-metadata.service';
|
|
10
|
-
import {
|
|
7
|
+
import { PollerService } from 'src/services/poller.service';
|
|
8
|
+
import { DatabaseSubscriber } from 'src/services/queues/database-subscriber.service';
|
|
9
|
+
import { McpResponse, QueuesModuleOptions, TriggerMcpClientOptions } from "../../interfaces";
|
|
10
|
+
import { MqMessageQueueService } from '../../services/mq-message-queue.service';
|
|
11
|
+
import { MqMessageService } from '../../services/mq-message.service';
|
|
11
12
|
export declare class TriggerMcpClientSubscriberDatabase extends DatabaseSubscriber<TriggerMcpClientOptions> {
|
|
12
13
|
readonly mqMessageService: MqMessageService;
|
|
13
14
|
readonly mqMessageQueueService: MqMessageQueueService;
|
|
@@ -16,8 +17,9 @@ export declare class TriggerMcpClientSubscriberDatabase extends DatabaseSubscrib
|
|
|
16
17
|
readonly moduleMetadataService: ModuleMetadataService;
|
|
17
18
|
readonly modelMetadataService: ModelMetadataService;
|
|
18
19
|
private readonly solidRegistry;
|
|
20
|
+
private readonly dashboardRepository;
|
|
19
21
|
private readonly triggerMcpClientSubscriberLogger;
|
|
20
|
-
constructor(mqMessageService: MqMessageService, mqMessageQueueService: MqMessageQueueService, poller: PollerService, aiInteractionService: AiInteractionService, moduleMetadataService: ModuleMetadataService, modelMetadataService: ModelMetadataService, solidRegistry: SolidRegistry);
|
|
22
|
+
constructor(mqMessageService: MqMessageService, mqMessageQueueService: MqMessageQueueService, poller: PollerService, aiInteractionService: AiInteractionService, moduleMetadataService: ModuleMetadataService, modelMetadataService: ModelMetadataService, solidRegistry: SolidRegistry, dashboardRepository: DashboardRepository);
|
|
21
23
|
options(): QueuesModuleOptions;
|
|
22
24
|
cleanNestedResponse(aiResponse: McpResponse): any;
|
|
23
25
|
subscribe(message: QueueMessage<TriggerMcpClientOptions>): Promise<McpResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-mcp-client-subscriber-database.service.d.ts","sourceRoot":"","sources":["../../../src/jobs/database/trigger-mcp-client-subscriber-database.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"trigger-mcp-client-subscriber-database.service.d.ts","sourceRoot":"","sources":["../../../src/jobs/database/trigger-mcp-client-subscriber-database.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,aAAa,E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AAmB,CAAC,UAAU,EAAE,WAAW;IA8BrC,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC,uBAAuB,CAAC;CAkOjE"}
|
|
@@ -15,17 +15,19 @@ var TriggerMcpClientSubscriberDatabase_1;
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.TriggerMcpClientSubscriberDatabase = void 0;
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
|
-
const
|
|
19
|
-
const mq_message_queue_service_1 = require("../../services/mq-message-queue.service");
|
|
20
|
-
const database_subscriber_service_1 = require("../../services/queues/database-subscriber.service");
|
|
21
|
-
const trigger_mcp_client_queue_options_1 = __importDefault(require("./trigger-mcp-client-queue-options"));
|
|
22
|
-
const ai_interaction_service_1 = require("../../services/ai-interaction.service");
|
|
23
|
-
const poller_service_1 = require("../../services/poller.service");
|
|
18
|
+
const src_1 = require("../..");
|
|
24
19
|
const solid_registry_1 = require("../../helpers/solid-registry");
|
|
20
|
+
const dashboard_repository_1 = require("../../repository/dashboard.repository");
|
|
21
|
+
const ai_interaction_service_1 = require("../../services/ai-interaction.service");
|
|
25
22
|
const module_metadata_service_1 = require("../../services/module-metadata.service");
|
|
26
|
-
const
|
|
23
|
+
const poller_service_1 = require("../../services/poller.service");
|
|
24
|
+
const database_subscriber_service_1 = require("../../services/queues/database-subscriber.service");
|
|
25
|
+
const typeorm_1 = require("typeorm");
|
|
26
|
+
const mq_message_queue_service_1 = require("../../services/mq-message-queue.service");
|
|
27
|
+
const mq_message_service_1 = require("../../services/mq-message.service");
|
|
28
|
+
const trigger_mcp_client_queue_options_1 = __importDefault(require("./trigger-mcp-client-queue-options"));
|
|
27
29
|
let TriggerMcpClientSubscriberDatabase = TriggerMcpClientSubscriberDatabase_1 = class TriggerMcpClientSubscriberDatabase extends database_subscriber_service_1.DatabaseSubscriber {
|
|
28
|
-
constructor(mqMessageService, mqMessageQueueService, poller, aiInteractionService, moduleMetadataService, modelMetadataService, solidRegistry) {
|
|
30
|
+
constructor(mqMessageService, mqMessageQueueService, poller, aiInteractionService, moduleMetadataService, modelMetadataService, solidRegistry, dashboardRepository) {
|
|
29
31
|
super(mqMessageService, mqMessageQueueService, poller);
|
|
30
32
|
this.mqMessageService = mqMessageService;
|
|
31
33
|
this.mqMessageQueueService = mqMessageQueueService;
|
|
@@ -34,6 +36,7 @@ let TriggerMcpClientSubscriberDatabase = TriggerMcpClientSubscriberDatabase_1 =
|
|
|
34
36
|
this.moduleMetadataService = moduleMetadataService;
|
|
35
37
|
this.modelMetadataService = modelMetadataService;
|
|
36
38
|
this.solidRegistry = solidRegistry;
|
|
39
|
+
this.dashboardRepository = dashboardRepository;
|
|
37
40
|
this.triggerMcpClientSubscriberLogger = new common_1.Logger(TriggerMcpClientSubscriberDatabase_1.name);
|
|
38
41
|
}
|
|
39
42
|
options() {
|
|
@@ -112,6 +115,13 @@ let TriggerMcpClientSubscriberDatabase = TriggerMcpClientSubscriberDatabase_1 =
|
|
|
112
115
|
limit: 1000,
|
|
113
116
|
populate: ['module']
|
|
114
117
|
});
|
|
118
|
+
const existingDashboards = await this.dashboardRepository.find({
|
|
119
|
+
where: {
|
|
120
|
+
module: {
|
|
121
|
+
name: (0, typeorm_1.Not)('solid-core')
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
});
|
|
115
125
|
const modulesSection = (existingModules ?? [])
|
|
116
126
|
.map(m => [
|
|
117
127
|
`### ${m.displayName}`,
|
|
@@ -127,6 +137,13 @@ let TriggerMcpClientSubscriberDatabase = TriggerMcpClientSubscriberDatabase_1 =
|
|
|
127
137
|
`- moduleName: ${m.module.name}`,
|
|
128
138
|
].join('\n'))
|
|
129
139
|
.join('\n\n');
|
|
140
|
+
const dashboardsSection = (existingDashboards ?? [])
|
|
141
|
+
.map(d => [
|
|
142
|
+
`### ${d.displayName}`,
|
|
143
|
+
`- name: ${d.name}`,
|
|
144
|
+
`- description: ${d.description ?? ""}`,
|
|
145
|
+
].join('\n'))
|
|
146
|
+
.join('\n\n');
|
|
130
147
|
const computationProvidersSection = (existingComputationProviders ?? [])
|
|
131
148
|
.map(m => [
|
|
132
149
|
`### ${m.instance.name()}`,
|
|
@@ -148,15 +165,21 @@ ${prompt}
|
|
|
148
165
|
# LISTS FOR REFERENCE AND VALIDATIONS
|
|
149
166
|
|
|
150
167
|
## LIST OF EXISTING MODULES
|
|
151
|
-
Use the below list of
|
|
168
|
+
Use the below list of modules to infer which module the user is referring to, .
|
|
152
169
|
|
|
153
170
|
${modulesSection}
|
|
154
171
|
|
|
155
172
|
## LIST OF EXISTING MODELS
|
|
156
|
-
Use the below list of
|
|
173
|
+
Use the below list of models to infer which model the user is referring to.
|
|
174
|
+
You need to pull out the singularName for the model from the user prompt to match against the below list.
|
|
157
175
|
|
|
158
176
|
${modelsSection}
|
|
159
177
|
|
|
178
|
+
## LIST OF EXISTING DASHBOARDS
|
|
179
|
+
Use the below list of dashboards to infer which dashboard the user is referring to.
|
|
180
|
+
|
|
181
|
+
${dashboardsSection}
|
|
182
|
+
|
|
160
183
|
## LIST OF EXISTING COMPUTED FIELD PROVIDERS
|
|
161
184
|
Use the below list of computed field providers to infer which provider the user is referring to.
|
|
162
185
|
|
|
@@ -204,6 +227,7 @@ exports.TriggerMcpClientSubscriberDatabase = TriggerMcpClientSubscriberDatabase
|
|
|
204
227
|
ai_interaction_service_1.AiInteractionService,
|
|
205
228
|
module_metadata_service_1.ModuleMetadataService,
|
|
206
229
|
src_1.ModelMetadataService,
|
|
207
|
-
solid_registry_1.SolidRegistry
|
|
230
|
+
solid_registry_1.SolidRegistry,
|
|
231
|
+
dashboard_repository_1.DashboardRepository])
|
|
208
232
|
], TriggerMcpClientSubscriberDatabase);
|
|
209
233
|
//# sourceMappingURL=trigger-mcp-client-subscriber-database.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-mcp-client-subscriber-database.service.js","sourceRoot":"","sources":["../../../src/jobs/database/trigger-mcp-client-subscriber-database.service.ts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AI,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;YAC3E,CAAC;QACL,CAAC;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ,CAAA;AAvPY,gFAAkC;6CAAlC,kCAAkC;IAD9C,IAAA,mBAAU,GAAE;qCAKsB,qCAAgB;QACX,gDAAqB;QACpC,8BAAa;QACC,6CAAoB;QACnB,+CAAqB;QACtB,0BAAoB;QACnB,8BAAa;GAVxC,kCAAkC,CAuP9C","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { QueueMessage } from 'src/interfaces/mq';\nimport { MqMessageService } from '../../services/mq-message.service';\nimport { MqMessageQueueService } from '../../services/mq-message-queue.service';\nimport { McpResponse, QueuesModuleOptions, TriggerMcpClientOptions } from \"../../interfaces\";\nimport { DatabaseSubscriber } from 'src/services/queues/database-subscriber.service';\nimport triggerMcpClientQueueOptions from \"./trigger-mcp-client-queue-options\";\nimport { AiInteractionService } from 'src/services/ai-interaction.service';\nimport { PollerService } from 'src/services/poller.service';\nimport { SolidRegistry } from 'src/helpers/solid-registry';\nimport { ModuleMetadataService } from 'src/services/module-metadata.service';\nimport { ModelMetadataService } from 'src';\n\n@Injectable()\nexport class TriggerMcpClientSubscriberDatabase extends DatabaseSubscriber<TriggerMcpClientOptions> {\n private readonly triggerMcpClientSubscriberLogger = new Logger(TriggerMcpClientSubscriberDatabase.name);\n\n constructor(\n readonly mqMessageService: MqMessageService,\n readonly mqMessageQueueService: MqMessageQueueService,\n readonly poller: PollerService,\n readonly aiInteractionService: AiInteractionService,\n readonly moduleMetadataService: ModuleMetadataService,\n readonly modelMetadataService: ModelMetadataService,\n private readonly solidRegistry: SolidRegistry,\n\n ) {\n super(mqMessageService, mqMessageQueueService, poller);\n }\n\n options(): QueuesModuleOptions {\n return {\n ...triggerMcpClientQueueOptions\n }\n }\n\n cleanNestedResponse(aiResponse: McpResponse) {\n let nestedResponse: any;\n\n try {\n let raw = aiResponse.response;\n\n if (typeof raw === \"string\") {\n raw = raw.trim();\n try {\n // Try to parse as JSON\n nestedResponse = JSON.parse(raw);\n } catch {\n // Not JSON, just keep as string\n nestedResponse = raw;\n }\n } else if (typeof raw === \"object\" && raw !== null) {\n // Already JSON\n nestedResponse = raw;\n } else {\n // Fallback\n nestedResponse = String(raw);\n }\n } catch (err) {\n this.triggerMcpClientSubscriberLogger.error(\"Error processing AI response:\", err);\n nestedResponse = `Error handling response: ${err?.message || String(err)}`;\n }\n\n return nestedResponse;\n }\n\n async subscribe(message: QueueMessage<TriggerMcpClientOptions>) {\n this.triggerMcpClientSubscriberLogger.debug(`Received message: ${JSON.stringify(message)}`);\n\n const codeGnerationOptions = message.payload;\n\n const aiInteraction = await this.aiInteractionService.findOne(codeGnerationOptions.aiInteractionId, {\n populate: ['user']\n });\n if (!aiInteraction) {\n const m = `Unable to identified the aiInteraction entry that triggered this job... using id: ${codeGnerationOptions.aiInteractionId}`\n this.triggerMcpClientSubscriberLogger.log(m);\n throw new Error(m);\n }\n\n // The message contains the users prompt.\n const prompt = aiInteraction.message;\n\n // Use this to invoke our mcp client\n // TODO: try / catch ... \n // Handle the rejection gracefully...\n\n // We create the aiInteraction entry first \n const genAiInteraction = await this.aiInteractionService.create({\n userId: aiInteraction.user.id,\n threadId: aiInteraction.threadId,\n parentInteractionId: aiInteraction.id,\n role: 'gen-ai',\n message: '...', // Updated in the tool\n contentType: '', // Updated in the tool\n errorMessage: '', // Updated after we receive the response\n modelUsed: '', // Updated after we receive the response\n responseTimeMs: 0, // Updated after we receive the response\n metadata: '', // Updated in the tool\n isApplied: false, // Updated after we receive the response\n status: 'pending' // Updated after we receive the response\n });\n\n const existingComputationProviders = this.solidRegistry.getComputedFieldProviders();\n\n const { records: existingModules } = await this.moduleMetadataService.findMany({\n filters: {\n name: { $ne: 'solid-core' }\n },\n fields: ['id', 'name', 'displayName', 'description'],\n limit: 1000\n });\n const { records: existingModels } = await this.modelMetadataService.findMany({\n filters: {\n module: {\n name: {\n $ne: 'solid-core',\n }\n }\n },\n limit: 1000,\n populate: ['module']\n });\n\n // Build markdown sections using template interpolation\n const modulesSection = (existingModules ?? [])\n .map(m => [\n `### ${m.displayName}`,\n `- name: ${m.name}`,\n `- description: ${m.description ?? \"\"}`,\n ].join('\\n'))\n .join('\\n\\n');\n\n const modelsSection = (existingModels ?? [])\n .map(m => [\n `### ${m.displayName}`,\n `- singularName: ${m.singularName}`,\n `- description: ${m.description ?? \"\"}`,\n `- moduleName: ${m.module.name}`,\n ].join('\\n'))\n .join('\\n\\n');\n\n const computationProvidersSection = (existingComputationProviders ?? [])\n .map(m => [\n `### ${m.instance.name()}`,\n `- name: ${m.instance.name()}`,\n `- description: ${m.instance.help() ?? \"\"}`,\n ].join('\\n'))\n .join('\\n\\n');\n\n const finalPrompt = `\n# User Prompt: \n${prompt}\n\n# System Instructions:\n- aiInteractionId: ${genAiInteraction.id}\n- You will be invoking tools if needed, hence you will have to choose the applicable tools based on the tool context given to you.\n- If a tool is invoked, you must return **exactly** the raw output from the tool, without any json envelopes, additional formatting, commentary, or text.\n- Do not wrap the result in quotes, JSON, or markdown fences.\n- Do not explain what the result means.\n\n# LISTS FOR REFERENCE AND VALIDATIONS\n\n## LIST OF EXISTING MODULES\nUse the below list of models with module names to infer which module & models the user is referring to, you can try to pull out the singularName incase of models.\n\n${modulesSection}\n\n## LIST OF EXISTING MODELS\nUse the below list of modules to infer which module the user is referring to.\n\n${modelsSection}\n\n## LIST OF EXISTING COMPUTED FIELD PROVIDERS\nUse the below list of computed field providers to infer which provider the user is referring to.\n\n${computationProvidersSection}\n`.trim();\n\n const aiResponse = await this.aiInteractionService.runMcpPrompt(finalPrompt);\n this.triggerMcpClientSubscriberLogger.log(`aiResponse: `);\n this.triggerMcpClientSubscriberLogger.log(JSON.stringify(aiResponse));\n\n if (!aiResponse.success) {\n this.triggerMcpClientSubscriberLogger.log(`Gen ai has returned with a false status code`);\n\n const errorsStr = aiResponse.errors?.join('\\n ');\n const errorTrace = aiResponse.error_trace?.join('\\n');\n\n // await this.aiInteractionService.create({\n // userId: aiInteraction.user.id,\n // threadId: aiInteraction.threadId,\n // parentInteractionId: aiInteraction.id,\n // role: 'gen-ai',\n // message: '-',\n // contentType: aiResponse.content_type,\n // errorMessage: errorsStr,\n // modelUsed: aiResponse.model,\n // responseTimeMs: aiResponse.duration_ms,\n // metadata: JSON.stringify(aiResponse, null, 2),\n // isApplied: aiInteraction.isApplied,\n // status: aiResponse.success ? 'succeeded' : 'failed'\n // });\n\n // TODO: Update the previously created genAiInteraction record with the respective error fields and save to DB\n await this.aiInteractionService.update(genAiInteraction.id, {\n // contentType: aiResponse.content_type,\n errorMessage: `${errorsStr}\\n\\n${errorTrace}`,\n modelUsed: aiResponse.model,\n responseTimeMs: aiResponse.duration_ms,\n isApplied: aiInteraction.isApplied,\n status: aiResponse.success ? 'succeeded' : 'failed'\n }, [], true);\n\n // update the job entry with failure... raising an error will lead the job to be marked as failed...\n throw new Error(errorsStr);\n }\n else {\n let nestedResponse = this.cleanNestedResponse(aiResponse);\n\n // const genAiInteraction = await this.aiInteractionService.create({\n // userId: aiInteraction.user.id,\n // threadId: aiInteraction.threadId,\n // parentInteractionId: aiInteraction.id,\n // role: 'gen-ai',\n // message: nestedResponse,\n // contentType: aiResponse.content_type,\n // errorMessage: '',\n // modelUsed: aiResponse.model,\n // responseTimeMs: aiResponse.duration_ms,\n // metadata: JSON.stringify(aiResponse, null, 2),\n // isApplied: aiInteraction.isApplied,\n // status: aiResponse.success ? 'succeeded' : 'failed'\n // });\n\n // TODO: Update the previously created genAiInteraction record with the respective success fields and save to DB\n const errorsStr = nestedResponse?.status == \"error\" && nestedResponse?.errors.join('\\n ');\n // const errorTrace = nestedResponse?.status == \"error\" && nestedResponse?.error_trace?.join('\\n');\n\n\n await this.aiInteractionService.update(genAiInteraction.id, {\n errorMessage: nestedResponse.status == \"error\" ? `${errorsStr}` : \"\",\n // errorMessage:\"\",\n // contentType: aiResponse.content_type,\n // message: nestedResponse,\n modelUsed: aiResponse.model,\n responseTimeMs: aiResponse.duration_ms,\n isApplied: aiInteraction.isApplied,\n\n // status: aiResponse.success ? 'succeeded' : 'failed'\n status: aiResponse.success && nestedResponse.status == \"success\" ? 'succeeded' : 'failed'\n }, [], true);\n\n // If the human interaction was with isAutoApply=true, then we can go ahead and autoApply.\n if (aiInteraction.isAutoApply) {\n this.aiInteractionService.applySolidAiInteraction(genAiInteraction.id);\n }\n }\n\n return aiResponse;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"trigger-mcp-client-subscriber-database.service.js","sourceRoot":"","sources":["../../../src/jobs/database/trigger-mcp-client-subscriber-database.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,+BAA2C;AAC3C,iEAA2D;AAE3D,gFAA0E;AAC1E,kFAA2E;AAC3E,oFAA6E;AAC7E,kEAA4D;AAC5D,mGAAqF;AACrF,qCAA8B;AAE9B,sFAAgF;AAChF,0EAAqE;AACrE,0GAA8E;AAGvE,IAAM,kCAAkC,0CAAxC,MAAM,kCAAmC,SAAQ,gDAA2C;IAG/F,YACa,gBAAkC,EAClC,qBAA4C,EAC5C,MAAqB,EACrB,oBAA0C,EAC1C,qBAA4C,EAC5C,oBAA0C,EAClC,aAA4B,EAE5B,mBAAwC;QAGzD,KAAK,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,CAAC,CAAC;QAX9C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,WAAM,GAAN,MAAM,CAAe;QACrB,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,yBAAoB,GAApB,oBAAoB,CAAsB;QAClC,kBAAa,GAAb,aAAa,CAAe;QAE5B,wBAAmB,GAAnB,mBAAmB,CAAqB;QAX5C,qCAAgC,GAAG,IAAI,eAAM,CAAC,oCAAkC,CAAC,IAAI,CAAC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ACX,gDAAqB;QACpC,8BAAa;QACC,6CAAoB;QACnB,+CAAqB;QACtB,0BAAoB;QACnB,8BAAa;QAEP,0CAAmB;GAZpD,kCAAkC,CAwR9C","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { ModelMetadataService } from 'src';\nimport { SolidRegistry } from 'src/helpers/solid-registry';\nimport { QueueMessage } from 'src/interfaces/mq';\nimport { DashboardRepository } from 'src/repository/dashboard.repository';\nimport { AiInteractionService } from 'src/services/ai-interaction.service';\nimport { ModuleMetadataService } from 'src/services/module-metadata.service';\nimport { PollerService } from 'src/services/poller.service';\nimport { DatabaseSubscriber } from 'src/services/queues/database-subscriber.service';\nimport { Not } from 'typeorm';\nimport { McpResponse, QueuesModuleOptions, TriggerMcpClientOptions } from \"../../interfaces\";\nimport { MqMessageQueueService } from '../../services/mq-message-queue.service';\nimport { MqMessageService } from '../../services/mq-message.service';\nimport triggerMcpClientQueueOptions from \"./trigger-mcp-client-queue-options\";\n\n@Injectable()\nexport class TriggerMcpClientSubscriberDatabase extends DatabaseSubscriber<TriggerMcpClientOptions> {\n private readonly triggerMcpClientSubscriberLogger = new Logger(TriggerMcpClientSubscriberDatabase.name);\n\n constructor(\n readonly mqMessageService: MqMessageService,\n readonly mqMessageQueueService: MqMessageQueueService,\n readonly poller: PollerService,\n readonly aiInteractionService: AiInteractionService,\n readonly moduleMetadataService: ModuleMetadataService,\n readonly modelMetadataService: ModelMetadataService,\n private readonly solidRegistry: SolidRegistry,\n // private readonly dashboardService: DashboardService\n private readonly dashboardRepository: DashboardRepository\n\n ) {\n super(mqMessageService, mqMessageQueueService, poller);\n }\n\n options(): QueuesModuleOptions {\n return {\n ...triggerMcpClientQueueOptions\n }\n }\n\n cleanNestedResponse(aiResponse: McpResponse) {\n let nestedResponse: any;\n\n try {\n let raw = aiResponse.response;\n\n if (typeof raw === \"string\") {\n raw = raw.trim();\n try {\n // Try to parse as JSON\n nestedResponse = JSON.parse(raw);\n } catch {\n // Not JSON, just keep as string\n nestedResponse = raw;\n }\n } else if (typeof raw === \"object\" && raw !== null) {\n // Already JSON\n nestedResponse = raw;\n } else {\n // Fallback\n nestedResponse = String(raw);\n }\n } catch (err) {\n this.triggerMcpClientSubscriberLogger.error(\"Error processing AI response:\", err);\n nestedResponse = `Error handling response: ${err?.message || String(err)}`;\n }\n\n return nestedResponse;\n }\n\n async subscribe(message: QueueMessage<TriggerMcpClientOptions>) {\n this.triggerMcpClientSubscriberLogger.debug(`Received message: ${JSON.stringify(message)}`);\n\n const codeGnerationOptions = message.payload;\n\n const aiInteraction = await this.aiInteractionService.findOne(codeGnerationOptions.aiInteractionId, {\n populate: ['user']\n });\n if (!aiInteraction) {\n const m = `Unable to identified the aiInteraction entry that triggered this job... using id: ${codeGnerationOptions.aiInteractionId}`\n this.triggerMcpClientSubscriberLogger.log(m);\n throw new Error(m);\n }\n\n // The message contains the users prompt.\n const prompt = aiInteraction.message;\n\n // Use this to invoke our mcp client\n // TODO: try / catch ... \n // Handle the rejection gracefully...\n\n // We create the aiInteraction entry first \n const genAiInteraction = await this.aiInteractionService.create({\n userId: aiInteraction.user.id,\n threadId: aiInteraction.threadId,\n parentInteractionId: aiInteraction.id,\n role: 'gen-ai',\n message: '...', // Updated in the tool\n contentType: '', // Updated in the tool\n errorMessage: '', // Updated after we receive the response\n modelUsed: '', // Updated after we receive the response\n responseTimeMs: 0, // Updated after we receive the response\n metadata: '', // Updated in the tool\n isApplied: false, // Updated after we receive the response\n status: 'pending' // Updated after we receive the response\n });\n\n const existingComputationProviders = this.solidRegistry.getComputedFieldProviders();\n\n const { records: existingModules } = await this.moduleMetadataService.findMany({\n filters: {\n name: { $ne: 'solid-core' }\n },\n fields: ['id', 'name', 'displayName', 'description'],\n limit: 1000\n });\n const { records: existingModels } = await this.modelMetadataService.findMany({\n filters: {\n module: {\n name: {\n $ne: 'solid-core',\n }\n }\n },\n limit: 1000,\n populate: ['module']\n });\n\n // Get the list of dashboards\n // TODO: Ideally we should fetch dashboard like below, but used below approach to avoid below CLS issues for now.\n // Cannot set the key \"filter\". No CLS context available, please make sure that a ClsMiddleware/Guard/Interceptor has set up the context, or wrap any calls that depend on CLS with \"ClsService#run\"\n // const { records: existingDashboards } = await this.dashboardService.find({\n // fields\n // })\n const existingDashboards = await this.dashboardRepository.find(\n {\n where: {\n module: {\n name: Not('solid-core')\n }\n },\n }\n );\n\n // Build markdown sections using template interpolation\n const modulesSection = (existingModules ?? [])\n .map(m => [\n `### ${m.displayName}`,\n `- name: ${m.name}`,\n `- description: ${m.description ?? \"\"}`,\n ].join('\\n'))\n .join('\\n\\n');\n\n const modelsSection = (existingModels ?? [])\n .map(m => [\n `### ${m.displayName}`,\n `- singularName: ${m.singularName}`,\n `- description: ${m.description ?? \"\"}`,\n `- moduleName: ${m.module.name}`,\n ].join('\\n'))\n .join('\\n\\n');\n\n const dashboardsSection = (existingDashboards ?? [])\n .map(d => [\n `### ${d.displayName}`,\n `- name: ${d.name}`,\n `- description: ${d.description ?? \"\"}`,\n ].join('\\n'))\n .join('\\n\\n'); \n\n const computationProvidersSection = (existingComputationProviders ?? [])\n .map(m => [\n `### ${m.instance.name()}`,\n `- name: ${m.instance.name()}`,\n `- description: ${m.instance.help() ?? \"\"}`,\n ].join('\\n'))\n .join('\\n\\n');\n\n\n const finalPrompt = `\n# User Prompt: \n${prompt}\n\n# System Instructions:\n- aiInteractionId: ${genAiInteraction.id}\n- You will be invoking tools if needed, hence you will have to choose the applicable tools based on the tool context given to you.\n- If a tool is invoked, you must return **exactly** the raw output from the tool, without any json envelopes, additional formatting, commentary, or text.\n- Do not wrap the result in quotes, JSON, or markdown fences.\n- Do not explain what the result means.\n\n# LISTS FOR REFERENCE AND VALIDATIONS\n\n## LIST OF EXISTING MODULES\nUse the below list of modules to infer which module the user is referring to, .\n\n${modulesSection}\n\n## LIST OF EXISTING MODELS\nUse the below list of models to infer which model the user is referring to.\nYou need to pull out the singularName for the model from the user prompt to match against the below list.\n\n${modelsSection}\n\n## LIST OF EXISTING DASHBOARDS\nUse the below list of dashboards to infer which dashboard the user is referring to.\n\n${dashboardsSection}\n\n## LIST OF EXISTING COMPUTED FIELD PROVIDERS\nUse the below list of computed field providers to infer which provider the user is referring to.\n\n${computationProvidersSection}\n`.trim();\n\n const aiResponse = await this.aiInteractionService.runMcpPrompt(finalPrompt);\n this.triggerMcpClientSubscriberLogger.log(`aiResponse: `);\n this.triggerMcpClientSubscriberLogger.log(JSON.stringify(aiResponse));\n\n if (!aiResponse.success) {\n this.triggerMcpClientSubscriberLogger.log(`Gen ai has returned with a false status code`);\n\n const errorsStr = aiResponse.errors?.join('\\n ');\n const errorTrace = aiResponse.error_trace?.join('\\n');\n\n // await this.aiInteractionService.create({\n // userId: aiInteraction.user.id,\n // threadId: aiInteraction.threadId,\n // parentInteractionId: aiInteraction.id,\n // role: 'gen-ai',\n // message: '-',\n // contentType: aiResponse.content_type,\n // errorMessage: errorsStr,\n // modelUsed: aiResponse.model,\n // responseTimeMs: aiResponse.duration_ms,\n // metadata: JSON.stringify(aiResponse, null, 2),\n // isApplied: aiInteraction.isApplied,\n // status: aiResponse.success ? 'succeeded' : 'failed'\n // });\n\n // TODO: Update the previously created genAiInteraction record with the respective error fields and save to DB\n await this.aiInteractionService.update(genAiInteraction.id, {\n // contentType: aiResponse.content_type,\n errorMessage: `${errorsStr}\\n\\n${errorTrace}`,\n modelUsed: aiResponse.model,\n responseTimeMs: aiResponse.duration_ms,\n isApplied: aiInteraction.isApplied,\n status: aiResponse.success ? 'succeeded' : 'failed'\n }, [], true);\n\n // update the job entry with failure... raising an error will lead the job to be marked as failed...\n throw new Error(errorsStr);\n }\n else {\n let nestedResponse = this.cleanNestedResponse(aiResponse);\n\n // const genAiInteraction = await this.aiInteractionService.create({\n // userId: aiInteraction.user.id,\n // threadId: aiInteraction.threadId,\n // parentInteractionId: aiInteraction.id,\n // role: 'gen-ai',\n // message: nestedResponse,\n // contentType: aiResponse.content_type,\n // errorMessage: '',\n // modelUsed: aiResponse.model,\n // responseTimeMs: aiResponse.duration_ms,\n // metadata: JSON.stringify(aiResponse, null, 2),\n // isApplied: aiInteraction.isApplied,\n // status: aiResponse.success ? 'succeeded' : 'failed'\n // });\n\n // TODO: Update the previously created genAiInteraction record with the respective success fields and save to DB\n const errorsStr = nestedResponse?.status == \"error\" && nestedResponse?.errors.join('\\n ');\n // const errorTrace = nestedResponse?.status == \"error\" && nestedResponse?.error_trace?.join('\\n');\n\n\n await this.aiInteractionService.update(genAiInteraction.id, {\n errorMessage: nestedResponse.status == \"error\" ? `${errorsStr}` : \"\",\n // errorMessage:\"\",\n // contentType: aiResponse.content_type,\n // message: nestedResponse,\n modelUsed: aiResponse.model,\n responseTimeMs: aiResponse.duration_ms,\n isApplied: aiInteraction.isApplied,\n\n // status: aiResponse.success ? 'succeeded' : 'failed'\n status: aiResponse.success && nestedResponse.status == \"success\" ? 'succeeded' : 'failed'\n }, [], true);\n\n // If the human interaction was with isAutoApply=true, then we can go ahead and autoApply.\n if (aiInteraction.isAutoApply) {\n this.aiInteractionService.applySolidAiInteraction(genAiInteraction.id);\n }\n }\n\n return aiResponse;\n }\n}\n"]}
|