@acorex-platform/extension-ai-entity-client 0.0.32 → 0.0.37

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.
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-extension-ai-entity-client.mjs","sources":["../../../../libs/extensions/ai/entity/client/src/lib/ai-entity-assist.constants.ts","../../../../libs/extensions/ai/entity/client/src/lib/ai-entity-actions.modifier.ts","../../../../libs/extensions/ai/entity/client/src/lib/ai-entity-assist.service.ts","../../../../libs/extensions/ai/entity/client/src/lib/ai-entity-extension.module.ts","../../../../libs/extensions/ai/entity/client/src/lib/commands/ai-entity-assist.command.ts","../../../../libs/extensions/ai/entity/client/src/acorex-platform-extension-ai-entity-client.ts"],"sourcesContent":["//#region ---- Command & action keys ----\n\n/** Runtime command key registered via {@link provideCommandSetups}. */\nexport const AXE_AI_ENTITY_ASSIST_COMMAND = 'AiEntity:Assist';\n\n/** Distinct action command names per scope (resolved to {@link AXE_AI_ENTITY_ASSIST_COMMAND}). */\nexport const AXE_AI_ENTITY_ASSIST_ACTION = {\n typeLevel: 'ai-entity-assist-type-level',\n selected: 'ai-entity-assist-selected',\n individual: 'ai-entity-assist-individual',\n} as const;\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport { AXStyleColorType } from '@acorex/cdk/common';\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXE_AI_ENTITY_ASSIST_ACTION, AXE_AI_ENTITY_ASSIST_COMMAND } from './ai-entity-assist.constants';\n\n//#endregion\n\n//#region ---- Modifier config ----\n\nconst AI_ASSIST_ORDER = 45;\n\n/** Scopes injected on master list actions. */\nconst SCOPED_ACTIONS: ReadonlyArray<{\n scope: AXPEntityCommandScope;\n commandName: string;\n titleKey: string;\n priority: 'primary' | 'secondary' | 'none';\n}> = [\n {\n scope: AXPEntityCommandScope.TypeLevel,\n commandName: AXE_AI_ENTITY_ASSIST_ACTION.typeLevel,\n titleKey: '@extensions-ai-entity:actions.assist.type-level.title',\n priority: 'secondary',\n },\n {\n scope: AXPEntityCommandScope.Selected,\n commandName: AXE_AI_ENTITY_ASSIST_ACTION.selected,\n titleKey: '@extensions-ai-entity:actions.assist.selected.title',\n priority: 'secondary',\n },\n {\n scope: AXPEntityCommandScope.Individual,\n commandName: AXE_AI_ENTITY_ASSIST_ACTION.individual,\n titleKey: '@extensions-ai-entity:actions.assist.individual.title',\n priority: 'none',\n },\n ];\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction buildAssistAction(\n scope: AXPEntityCommandScope,\n commandName: string,\n titleKey: string,\n priority: 'primary' | 'secondary' | 'none',\n): AXPEntityAction {\n return {\n name: commandName,\n title: titleKey,\n command: {\n name: AXE_AI_ENTITY_ASSIST_COMMAND,\n options: {\n scope\n },\n },\n priority,\n color: 'accent1' as AXStyleColorType,\n type: AXPSystemActionType.Generate,\n scope,\n order: AI_ASSIST_ORDER,\n };\n}\n\nfunction appendScopedActions(actions: AXPEntityAction[]): void {\n for (const { scope, commandName, titleKey, priority } of SCOPED_ACTIONS) {\n if (!actionExists(actions, AXE_AI_ENTITY_ASSIST_COMMAND, commandName)) {\n actions.push(buildAssistAction(scope, commandName, titleKey, priority));\n }\n }\n}\n\n//#endregion\n\n//#region ---- Global modifier ----\n\n/**\n * Adds AI Assist to entity list (TypeLevel/Selected primary; Individual not a row command via priority `none`)\n * and single view (Individual primary in header).\n */\nexport const AXEAiEntityActionsModifier: AXPEntityModifierProvider = {\n entityName: '*',\n modifier: (ctx) => {\n ensureListActions(ctx);\n\n ctx.interfaces.update((interfaces) => {\n const next = (interfaces ?? {}) as Record<string, unknown>;\n const master = (next['master'] ?? {}) as Record<string, unknown>;\n const list = (master['list'] ?? { actions: [], views: [] }) as Record<string, unknown>;\n const listActions = (list['actions'] ?? []) as AXPEntityAction[];\n appendScopedActions(listActions);\n list['actions'] = listActions;\n master['list'] = list;\n\n const single = master['single'] as Record<string, unknown> | undefined;\n if (single) {\n const singleActions = (single['actions'] ?? []) as AXPEntityAction[];\n if (!actionExists(singleActions, AXE_AI_ENTITY_ASSIST_COMMAND, AXE_AI_ENTITY_ASSIST_ACTION.individual)) {\n singleActions.push(\n buildAssistAction(\n AXPEntityCommandScope.Individual,\n AXE_AI_ENTITY_ASSIST_ACTION.individual,\n '@extensions-ai-entity:actions.assist.individual.title',\n 'secondary',\n ),\n );\n }\n single['actions'] = singleActions;\n }\n\n next['master'] = master;\n return next as typeof interfaces;\n });\n },\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPEntity, AXPEntityCommandScope, AXPEntityProperty } from '@acorex-platform/framework-shared/entity';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPAiManagerService } from '@acorex-platform/module-ai-management-client';\n\nimport { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport { inject, Injectable } from '@angular/core';\nimport type {\n AXEAiEntityAssistCommandContext,\n AXEAiEntityAssistCommandOptions,\n} from '@acorex-platform/extension-ai-entity-client/contracts';\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst ENTITY_AI_LOADING_I18N_PREFIX = '@extensions-ai-entity:assist.loading';\nconst MAX_PROPERTIES_IN_SUMMARY = 48;\n\n//#endregion\n\n//#region ---- Context builders ----\n\ninterface AXEAiEntityPropertySummary {\n name: string;\n title: string;\n dataType: string;\n widgetType?: string;\n}\n\nfunction summarizeProperties(properties: AXPEntityProperty[] | undefined): AXEAiEntityPropertySummary[] {\n const list = properties ?? [];\n return list.slice(0, MAX_PROPERTIES_IN_SUMMARY).map((p) => ({\n name: p.name,\n title: p.title,\n dataType: p.schema?.dataType ?? 'unknown',\n widgetType: p.schema?.interface?.type,\n }));\n}\n\nfunction scopeLabel(scope: AXPEntityCommandScope): string {\n switch (scope) {\n case AXPEntityCommandScope.TypeLevel:\n return 'type-level (list, no row selection)';\n case AXPEntityCommandScope.Selected:\n return 'selected rows (bulk context)';\n case AXPEntityCommandScope.Individual:\n return 'individual row';\n default:\n return scope;\n }\n}\n\nfunction buildSystemInstruction(\n entity: AXPEntity,\n scope: AXPEntityCommandScope,\n propertySummary: AXEAiEntityPropertySummary[],\n): string {\n const truncated = (entity.properties?.length ?? 0) > propertySummary.length;\n return [\n 'You are assisting a user working with an ACoreX Platform entity (CRUD list / record context).',\n `Entity: ${entity.module}.${entity.name} (${entity.title}).`,\n `Command scope: ${scopeLabel(scope)}.`,\n '',\n 'Scope behavior:',\n '- **typeLevel**: Help with list-level tasks (filters, sorting ideas, bulk create outlines, reporting questions) when no row is selected.',\n '- **selected**: Answer using the provided array of selected records; prefer bulk-safe suggestions.',\n '- **individual**: Focus on one record; you may suggest field-level edits the user can apply manually.',\n '',\n 'Property catalog (name, title, dataType, widgetType):',\n JSON.stringify(propertySummary, null, 2),\n truncated\n ? `(Only the first ${MAX_PROPERTIES_IN_SUMMARY} properties are listed; infer patterns for the rest.)`\n : '',\n '',\n 'Rules:',\n '- Reply in plain language unless the user asks for JSON.',\n '- Do not invent persisted ids or claim data was saved.',\n '- When suggesting field values, name fields by their `name` from the catalog.',\n ]\n .filter(Boolean)\n .join('\\n');\n}\n\nfunction resolveScope(options: AXEAiEntityAssistCommandOptions | undefined): AXPEntityCommandScope {\n const scope = options?.scope;\n if (\n scope === AXPEntityCommandScope.TypeLevel ||\n scope === AXPEntityCommandScope.Selected ||\n scope === AXPEntityCommandScope.Individual\n ) {\n return scope;\n }\n return AXPEntityCommandScope.TypeLevel;\n}\n\n//#endregion\n\n/**\n * Opens AI assist for entity CRUD views with entity schema and selection context.\n */\n@Injectable()\nexport class AXEAiEntityAssistService {\n //#region ---- Services & Dependencies ----\n\n private readonly aiManager = inject(AXPAiManagerService, { optional: true });\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n\n //#endregion\n\n //#region ---- Public API ----\n\n async runFromCommandContext(context: AXEAiEntityAssistCommandContext): Promise<void> {\n const ai = this.aiManager;\n if (!ai) {\n const title = await this.translationService.translateAsync('@general:messages.generic.warning.title');\n const content = await this.translationService.translateAsync('@extensions-ai-entity:assist.no-ai-module');\n await this.toastService.show({ color: 'warning', title, content });\n return;\n }\n\n const { entityInfo, data, options } = context;\n const scope = resolveScope(options);\n const entity = await this.entityRegistry.resolve(entityInfo.module, entityInfo.name);\n const propertySummary = summarizeProperties(entity.properties);\n const systemInstruction = buildSystemInstruction(entity, scope, propertySummary);\n\n const structuredContext = {\n scenario: 'entity-crud-assist',\n scope,\n entity: {\n module: entity.module,\n name: entity.name,\n title: entity.title,\n source: entityInfo.source ?? `${entity.module}.${entity.name}`,\n },\n propertyCount: entity.properties?.length ?? 0,\n properties: propertySummary,\n data,\n };\n\n const dialogTitleKey =\n scope === AXPEntityCommandScope.Selected\n ? '@extensions-ai-entity:assist.dialog-title.selected'\n : scope === AXPEntityCommandScope.Individual\n ? '@extensions-ai-entity:assist.dialog-title.individual'\n : '@extensions-ai-entity:assist.dialog-title.type-level';\n\n const [dialogTitle, placeholder, runLoadingTitle, runLoadingText] = await Promise.all([\n this.translationService.translateAsync(dialogTitleKey),\n this.translationService.translateAsync('@extensions-ai-entity:assist.placeholder'),\n this.translationService.translateAsync(`${ENTITY_AI_LOADING_I18N_PREFIX}.run-title`),\n this.translationService.translateAsync(`${ENTITY_AI_LOADING_I18N_PREFIX}.run-initial`),\n ]);\n\n const showResult = await ai.show({\n title: dialogTitle,\n placeholder,\n size: 'lg',\n context: {\n systemInstruction,\n structuredContext,\n },\n runLoadingDialog: {\n title: runLoadingTitle,\n text: runLoadingText,\n },\n });\n\n if (!showResult?.text?.trim()) {\n return;\n }\n\n const doneTitle = await this.translationService.translateAsync('@extensions-ai-entity:assist.result-toast-title');\n const preview =\n showResult.text.length > 600 ? `${showResult.text.slice(0, 600).trim()}…` : showResult.text.trim();\n await this.toastService.show({\n color: 'success',\n title: doneTitle,\n content: preview,\n });\n }\n\n //#endregion\n}\n","//#region ---- Imports ----\n\nimport { NgModule } from '@angular/core';\nimport { AXMAiManagementModule } from '@acorex-platform/module-ai-management-client';\nimport { AXP_ENTITY_MODIFIER } from '@acorex-platform/framework-client/layout/entity';\nimport { provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { AXEAiEntityActionsModifier } from './ai-entity-actions.modifier';\nimport { AXE_AI_ENTITY_ASSIST_COMMAND } from './ai-entity-assist.constants';\nimport { AXEAiEntityAssistService } from './ai-entity-assist.service';\n\n//#endregion\n\n//#region ---- Module ----\n\n/**\n * Optional AI assist on entity CRUD views (TypeLevel, Selected, Individual scopes).\n * Register next to {@link AXMAiManagementModule} in the application.\n */\n@NgModule({\n imports: [AXMAiManagementModule],\n providers: [\n AXEAiEntityAssistService,\n {\n provide: AXP_ENTITY_MODIFIER,\n useValue: AXEAiEntityActionsModifier,\n multi: true,\n },\n provideCommandSetups([\n {\n key: AXE_AI_ENTITY_ASSIST_COMMAND,\n command: () =>\n import('./commands/ai-entity-assist.command').then((c) => c.AXEAiEntityAssistCommand),\n },\n ]),\n ],\n})\nexport class AXEAIEntityExtensionModule { }\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\nimport { inject, Injectable } from '@angular/core';\nimport { AXEAiEntityAssistService } from '../ai-entity-assist.service';\nimport type { AXEAiEntityAssistCommandInput } from '@acorex-platform/extension-ai-entity-client/contracts';\n\n//#endregion\n\n//#region ---- Command ----\n\n/**\n * Entity list / row AI assist — opens {@link AXPAiManagerService} with entity schema and selection context.\n */\n@Injectable()\nexport class AXEAiEntityAssistCommand implements AXPCommand<AXEAiEntityAssistCommandInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly assist = inject(AXEAiEntityAssistService);\n\n //#endregion\n\n //#region ---- Command execution ----\n\n async execute(input: AXEAiEntityAssistCommandInput): AXPCommandExecuteResultPromise<void> {\n const result = await this.assist.runFromCommandContext(input);\n\n if (result == undefined) {\n return { success: false };\n }\n\n return { success: true, kind: 'object', data: undefined };\n }\n\n //#endregion\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAEA;AACO,MAAM,4BAA4B,GAAG;AAE5C;AACO,MAAM,2BAA2B,GAAG;AACzC,IAAA,SAAS,EAAE,6BAA6B;AACxC,IAAA,QAAQ,EAAE,2BAA2B;AACrC,IAAA,UAAU,EAAE,6BAA6B;;AAG3C;;ACZA;AAaA;AAEA;AAEA,MAAM,eAAe,GAAG,EAAE;AAE1B;AACA,MAAM,cAAc,GAKf;AACD,IAAA;QACE,KAAK,EAAE,qBAAqB,CAAC,SAAS;QACtC,WAAW,EAAE,2BAA2B,CAAC,SAAS;AAClD,QAAA,QAAQ,EAAE,uDAAuD;AACjE,QAAA,QAAQ,EAAE,WAAW;AACtB,KAAA;AACD,IAAA;QACE,KAAK,EAAE,qBAAqB,CAAC,QAAQ;QACrC,WAAW,EAAE,2BAA2B,CAAC,QAAQ;AACjD,QAAA,QAAQ,EAAE,qDAAqD;AAC/D,QAAA,QAAQ,EAAE,WAAW;AACtB,KAAA;AACD,IAAA;QACE,KAAK,EAAE,qBAAqB,CAAC,UAAU;QACvC,WAAW,EAAE,2BAA2B,CAAC,UAAU;AACnD,QAAA,QAAQ,EAAE,uDAAuD;AACjE,QAAA,QAAQ,EAAE,MAAM;AACjB,KAAA;CACF;AAEH;AAEA;AAEA,SAAS,iBAAiB,CACxB,KAA4B,EAC5B,WAAmB,EACnB,QAAgB,EAChB,QAA0C,EAAA;IAE1C,OAAO;AACL,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,KAAK,EAAE,QAAQ;AACf,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,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AE;AACvB,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;AAEA,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3D;8GAjBW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAxB,wBAAwB,EAAA,CAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC;;;;;;;;ACfD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-platform-extension-ai-entity-client.mjs","sources":["../../../../libs/extensions/ai/entity/client/src/lib/ai-entity-assist.constants.ts","../../../../libs/extensions/ai/entity/client/src/lib/ai-entity-actions.modifier.ts","../../../../libs/extensions/ai/entity/client/src/lib/ai-entity-assist.service.ts","../../../../libs/extensions/ai/entity/client/src/lib/ai-entity-extension.module.ts","../../../../libs/extensions/ai/entity/client/src/lib/commands/ai-entity-assist.command.ts","../../../../libs/extensions/ai/entity/client/src/acorex-platform-extension-ai-entity-client.ts"],"sourcesContent":["//#region ---- Command & action keys ----\n\n/** Runtime command key registered via {@link provideCommandSetups}. */\nexport const AXE_AI_ENTITY_ASSIST_COMMAND = 'AiEntity:Assist';\n\n/** Distinct action command names per scope (resolved to {@link AXE_AI_ENTITY_ASSIST_COMMAND}). */\nexport const AXE_AI_ENTITY_ASSIST_ACTION = {\n typeLevel: 'ai-entity-assist-type-level',\n selected: 'ai-entity-assist-selected',\n individual: 'ai-entity-assist-individual',\n} as const;\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport { AXStyleColorType } from '@acorex/cdk/common';\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXE_AI_ENTITY_ASSIST_ACTION, AXE_AI_ENTITY_ASSIST_COMMAND } from './ai-entity-assist.constants';\n\n//#endregion\n\n//#region ---- Modifier config ----\n\nconst AI_ASSIST_ORDER = 45;\n\n/** Scopes injected on master list actions. */\nconst SCOPED_ACTIONS: ReadonlyArray<{\n scope: AXPEntityCommandScope;\n commandName: string;\n titleKey: string;\n priority: 'primary' | 'secondary' | 'none';\n}> = [\n {\n scope: AXPEntityCommandScope.TypeLevel,\n commandName: AXE_AI_ENTITY_ASSIST_ACTION.typeLevel,\n titleKey: '@extensions-ai-entity:actions.assist.type-level.title',\n priority: 'secondary',\n },\n {\n scope: AXPEntityCommandScope.Selected,\n commandName: AXE_AI_ENTITY_ASSIST_ACTION.selected,\n titleKey: '@extensions-ai-entity:actions.assist.selected.title',\n priority: 'secondary',\n },\n {\n scope: AXPEntityCommandScope.Individual,\n commandName: AXE_AI_ENTITY_ASSIST_ACTION.individual,\n titleKey: '@extensions-ai-entity:actions.assist.individual.title',\n priority: 'none',\n },\n ];\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction buildAssistAction(\n scope: AXPEntityCommandScope,\n commandName: string,\n titleKey: string,\n priority: 'primary' | 'secondary' | 'none',\n): AXPEntityAction {\n return {\n name: commandName,\n title: titleKey,\n command: {\n name: AXE_AI_ENTITY_ASSIST_COMMAND,\n options: {\n scope\n },\n },\n priority,\n color: 'accent1' as AXStyleColorType,\n type: AXPSystemActionType.Generate,\n scope,\n order: AI_ASSIST_ORDER,\n };\n}\n\nfunction appendScopedActions(actions: AXPEntityAction[]): void {\n for (const { scope, commandName, titleKey, priority } of SCOPED_ACTIONS) {\n if (!actionExists(actions, AXE_AI_ENTITY_ASSIST_COMMAND, commandName)) {\n actions.push(buildAssistAction(scope, commandName, titleKey, priority));\n }\n }\n}\n\n//#endregion\n\n//#region ---- Global modifier ----\n\n/**\n * Adds AI Assist to entity list (TypeLevel/Selected primary; Individual not a row command via priority `none`)\n * and single view (Individual primary in header).\n */\nexport const AXEAiEntityActionsModifier: AXPEntityModifierProvider = {\n entityName: '*',\n modifier: (ctx) => {\n ensureListActions(ctx);\n\n ctx.interfaces.update((interfaces) => {\n const next = (interfaces ?? {}) as Record<string, unknown>;\n const master = (next['master'] ?? {}) as Record<string, unknown>;\n const list = (master['list'] ?? { actions: [], views: [] }) as Record<string, unknown>;\n const listActions = (list['actions'] ?? []) as AXPEntityAction[];\n appendScopedActions(listActions);\n list['actions'] = listActions;\n master['list'] = list;\n\n const single = master['single'] as Record<string, unknown> | undefined;\n if (single) {\n const singleActions = (single['actions'] ?? []) as AXPEntityAction[];\n if (!actionExists(singleActions, AXE_AI_ENTITY_ASSIST_COMMAND, AXE_AI_ENTITY_ASSIST_ACTION.individual)) {\n singleActions.push(\n buildAssistAction(\n AXPEntityCommandScope.Individual,\n AXE_AI_ENTITY_ASSIST_ACTION.individual,\n '@extensions-ai-entity:actions.assist.individual.title',\n 'secondary',\n ),\n );\n }\n single['actions'] = singleActions;\n }\n\n next['master'] = master;\n return next as typeof interfaces;\n });\n },\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPEntity, AXPEntityCommandScope, AXPEntityProperty } from '@acorex-platform/framework-shared/entity';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPAiManagerService } from '@acorex-platform/module-ai-management-client';\n\nimport { AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport { inject, Injectable } from '@angular/core';\nimport type {\n AXEAiEntityAssistCommandContext,\n AXEAiEntityAssistCommandOptions,\n} from '@acorex-platform/extension-ai-entity-client/contracts';\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst ENTITY_AI_LOADING_I18N_PREFIX = '@extensions-ai-entity:assist.loading';\nconst MAX_PROPERTIES_IN_SUMMARY = 48;\n\n//#endregion\n\n//#region ---- Context builders ----\n\ninterface AXEAiEntityPropertySummary {\n name: string;\n title: string;\n dataType: string;\n widgetType?: string;\n}\n\nfunction summarizeProperties(properties: AXPEntityProperty[] | undefined): AXEAiEntityPropertySummary[] {\n const list = properties ?? [];\n return list.slice(0, MAX_PROPERTIES_IN_SUMMARY).map((p) => ({\n name: p.name,\n title: p.title,\n dataType: p.schema?.dataType ?? 'unknown',\n widgetType: p.schema?.interface?.type,\n }));\n}\n\nfunction scopeLabel(scope: AXPEntityCommandScope): string {\n switch (scope) {\n case AXPEntityCommandScope.TypeLevel:\n return 'type-level (list, no row selection)';\n case AXPEntityCommandScope.Selected:\n return 'selected rows (bulk context)';\n case AXPEntityCommandScope.Individual:\n return 'individual row';\n default:\n return scope;\n }\n}\n\nfunction buildSystemInstruction(\n entity: AXPEntity,\n scope: AXPEntityCommandScope,\n propertySummary: AXEAiEntityPropertySummary[],\n): string {\n const truncated = (entity.properties?.length ?? 0) > propertySummary.length;\n return [\n 'You are assisting a user working with an ACoreX Platform entity (CRUD list / record context).',\n `Entity: ${entity.module}.${entity.name} (${entity.title}).`,\n `Command scope: ${scopeLabel(scope)}.`,\n '',\n 'Scope behavior:',\n '- **typeLevel**: Help with list-level tasks (filters, sorting ideas, bulk create outlines, reporting questions) when no row is selected.',\n '- **selected**: Answer using the provided array of selected records; prefer bulk-safe suggestions.',\n '- **individual**: Focus on one record; you may suggest field-level edits the user can apply manually.',\n '',\n 'Property catalog (name, title, dataType, widgetType):',\n JSON.stringify(propertySummary, null, 2),\n truncated\n ? `(Only the first ${MAX_PROPERTIES_IN_SUMMARY} properties are listed; infer patterns for the rest.)`\n : '',\n '',\n 'Rules:',\n '- Reply in plain language unless the user asks for JSON.',\n '- Do not invent persisted ids or claim data was saved.',\n '- When suggesting field values, name fields by their `name` from the catalog.',\n ]\n .filter(Boolean)\n .join('\\n');\n}\n\nfunction resolveScope(options: AXEAiEntityAssistCommandOptions | undefined): AXPEntityCommandScope {\n const scope = options?.scope;\n if (\n scope === AXPEntityCommandScope.TypeLevel ||\n scope === AXPEntityCommandScope.Selected ||\n scope === AXPEntityCommandScope.Individual\n ) {\n return scope;\n }\n return AXPEntityCommandScope.TypeLevel;\n}\n\n//#endregion\n\n/**\n * Opens AI assist for entity CRUD views with entity schema and selection context.\n */\n@Injectable()\nexport class AXEAiEntityAssistService {\n //#region ---- Services & Dependencies ----\n\n private readonly aiManager = inject(AXPAiManagerService, { optional: true });\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n\n //#endregion\n\n //#region ---- Public API ----\n\n async runFromCommandContext(context: AXEAiEntityAssistCommandContext): Promise<void> {\n const ai = this.aiManager;\n if (!ai) {\n const title = await this.translationService.translateAsync('@general:messages.generic.warning.title');\n const content = await this.translationService.translateAsync('@extensions-ai-entity:assist.no-ai-module');\n await this.toastService.show({ color: 'warning', title, content });\n return;\n }\n\n const { entityInfo, data, options } = context;\n const scope = resolveScope(options);\n const entity = await this.entityRegistry.resolve(entityInfo.module, entityInfo.name);\n const propertySummary = summarizeProperties(entity.properties);\n const systemInstruction = buildSystemInstruction(entity, scope, propertySummary);\n\n const structuredContext = {\n scenario: 'entity-crud-assist',\n scope,\n entity: {\n module: entity.module,\n name: entity.name,\n title: entity.title,\n source: entityInfo.source ?? `${entity.module}.${entity.name}`,\n },\n propertyCount: entity.properties?.length ?? 0,\n properties: propertySummary,\n data,\n };\n\n const dialogTitleKey =\n scope === AXPEntityCommandScope.Selected\n ? '@extensions-ai-entity:assist.dialog-title.selected'\n : scope === AXPEntityCommandScope.Individual\n ? '@extensions-ai-entity:assist.dialog-title.individual'\n : '@extensions-ai-entity:assist.dialog-title.type-level';\n\n const [dialogTitle, placeholder, runLoadingTitle, runLoadingText] = await Promise.all([\n this.translationService.translateAsync(dialogTitleKey),\n this.translationService.translateAsync('@extensions-ai-entity:assist.placeholder'),\n this.translationService.translateAsync(`${ENTITY_AI_LOADING_I18N_PREFIX}.run-title`),\n this.translationService.translateAsync(`${ENTITY_AI_LOADING_I18N_PREFIX}.run-initial`),\n ]);\n\n const showResult = await ai.show({\n title: dialogTitle,\n placeholder,\n size: 'lg',\n context: {\n systemInstruction,\n structuredContext,\n },\n runLoadingDialog: {\n title: runLoadingTitle,\n text: runLoadingText,\n },\n });\n\n if (!showResult?.text?.trim()) {\n return;\n }\n\n const doneTitle = await this.translationService.translateAsync('@extensions-ai-entity:assist.result-toast-title');\n const preview =\n showResult.text.length > 600 ? `${showResult.text.slice(0, 600).trim()}…` : showResult.text.trim();\n await this.toastService.show({\n color: 'success',\n title: doneTitle,\n content: preview,\n });\n }\n\n //#endregion\n}\n","//#region ---- Imports ----\n\nimport { NgModule } from '@angular/core';\nimport { AXMAiManagementModule } from '@acorex-platform/module-ai-management-client';\nimport { AXP_ENTITY_MODIFIER } from '@acorex-platform/framework-client/layout/entity';\nimport { provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { AXEAiEntityActionsModifier } from './ai-entity-actions.modifier';\nimport { AXE_AI_ENTITY_ASSIST_COMMAND } from './ai-entity-assist.constants';\nimport { AXEAiEntityAssistService } from './ai-entity-assist.service';\n\n//#endregion\n\n//#region ---- Module ----\n\n/**\n * Optional AI assist on entity CRUD views (TypeLevel, Selected, Individual scopes).\n * Register next to {@link AXMAiManagementModule} in the application.\n */\n@NgModule({\n imports: [AXMAiManagementModule],\n providers: [\n AXEAiEntityAssistService,\n {\n provide: AXP_ENTITY_MODIFIER,\n useValue: AXEAiEntityActionsModifier,\n multi: true,\n },\n provideCommandSetups([\n {\n key: AXE_AI_ENTITY_ASSIST_COMMAND,\n command: () =>\n import('./commands/ai-entity-assist.command').then((c) => c.AXEAiEntityAssistCommand),\n },\n ]),\n ],\n})\nexport class AXEAIEntityExtensionModule { }\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\nimport { inject, Injectable } from '@angular/core';\nimport { AXEAiEntityAssistService } from '../ai-entity-assist.service';\nimport type { AXEAiEntityAssistCommandInput } from '@acorex-platform/extension-ai-entity-client/contracts';\n\n//#endregion\n\n//#region ---- Command ----\n\n/**\n * Entity list / row AI assist — opens {@link AXPAiManagerService} with entity schema and selection context.\n */\n@Injectable()\nexport class AXEAiEntityAssistCommand implements AXPCommand<AXEAiEntityAssistCommandInput, void> {\n //#region ---- Services & Dependencies ----\n\n private readonly assist = inject(AXEAiEntityAssistService);\n\n //#endregion\n\n //#region ---- Command execution ----\n\n async execute(input: AXEAiEntityAssistCommandInput): AXPCommandExecuteResultPromise<void> {\n const result = await this.assist.runFromCommandContext(input);\n\n if (result == undefined) {\n return { success: false };\n }\n\n return { success: true, kind: 'object', data: undefined };\n }\n\n //#endregion\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAEA;AACO,MAAM,4BAA4B,GAAG;AAE5C;AACO,MAAM,2BAA2B,GAAG;AACzC,IAAA,SAAS,EAAE,6BAA6B;AACxC,IAAA,QAAQ,EAAE,2BAA2B;AACrC,IAAA,UAAU,EAAE,6BAA6B;;AAG3C;;ACZA;AAaA;AAEA;AAEA,MAAM,eAAe,GAAG,EAAE;AAE1B;AACA,MAAM,cAAc,GAKf;AACD,IAAA;QACE,KAAK,EAAE,qBAAqB,CAAC,SAAS;QACtC,WAAW,EAAE,2BAA2B,CAAC,SAAS;AAClD,QAAA,QAAQ,EAAE,uDAAuD;AACjE,QAAA,QAAQ,EAAE,WAAW;AACtB,KAAA;AACD,IAAA;QACE,KAAK,EAAE,qBAAqB,CAAC,QAAQ;QACrC,WAAW,EAAE,2BAA2B,CAAC,QAAQ;AACjD,QAAA,QAAQ,EAAE,qDAAqD;AAC/D,QAAA,QAAQ,EAAE,WAAW;AACtB,KAAA;AACD,IAAA;QACE,KAAK,EAAE,qBAAqB,CAAC,UAAU;QACvC,WAAW,EAAE,2BAA2B,CAAC,UAAU;AACnD,QAAA,QAAQ,EAAE,uDAAuD;AACjE,QAAA,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AA,GAAA;;AAImB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAiB3D,IAAA;;;IAXC,MAAM,OAAO,CAAC,KAAoC,EAAA;QAChD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC;AAE7D,QAAA,IAAI,MAAM,IAAI,SAAS,EAAE;AACvB,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;AAEA,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3D;8GAjBW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAxB,wBAAwB,EAAA,CAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC;;;;;;;;ACfD;;AAEG;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex-platform/extension-ai-entity-client",
3
- "version": "0.0.32",
3
+ "version": "0.0.37",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0 || ^22.0.0",