@acorex-platform/module-ai-management-client 0.0.46 → 0.0.48

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,5 +1,5 @@
1
1
  import { AXPSessionService, AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/auth';
2
- import { AXPSettingsService, AXPFileStorageService, AXPOutputContractTranscriptSegmentService, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_OUTPUT_CONTRACT_TRANSCRIPT_SEGMENT_PROVIDER } from '@acorex-platform/framework-client/common';
2
+ import { AXP_SETTING_DEFINITION_PROVIDER, AXPSettingsService, AXPFileStorageService, AXPOutputContractTranscriptSegmentService, AXP_MENU_PROVIDER, AXP_OUTPUT_CONTRACT_TRANSCRIPT_SEGMENT_PROVIDER } from '@acorex-platform/framework-client/common';
3
3
  import * as i1$1 from '@acorex-platform/framework-client/core';
4
4
  import { objectKeyValueTransforms, AXPTagProvider, AXPComponentSlotModule, AXP_FEATURE_DEFINITION_PROVIDER, AXP_TAG_PROVIDER, AXP_CONTEXT_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/core';
5
5
  import { AXP_WIDGETS_EDITOR_CATEGORY, AXP_WIDGET_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/layout/widget-core';
@@ -216,6 +216,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
216
216
  const I18N = '@ai-management:settings';
217
217
  class AXMAiManagementSettingProvider {
218
218
  async provide(context) {
219
+ // Extensions attach their own AI sections on this group (for example document reading and form designer).
219
220
  context
220
221
  .addGroup('ai-settings', `${I18N}.group.nav-title`, `${I18N}.group.description`, 'fa-light fa-robot', `${I18N}.group.title`, 60)
221
222
  .addSection('global-ai', `${I18N}.section.global-ai.title`, `${I18N}.section.global-ai.description`)
@@ -260,6 +261,22 @@ class AXMAiManagementSettingProvider {
260
261
  description: `${I18N}.global-system-prompt.prefix.description`,
261
262
  })
262
263
  .endSection()
264
+ .endGroup();
265
+ }
266
+ }
267
+ /**
268
+ * Registered after other Intelligence sections so Google Gemini stays last in that category.
269
+ */
270
+ class AXMAiManagementGeminiSettingProvider {
271
+ async provide(context) {
272
+ if (!context.hasGroup('ai-settings')) {
273
+ return;
274
+ }
275
+ const intelligence = context.group('ai-settings');
276
+ if (!intelligence) {
277
+ return;
278
+ }
279
+ intelligence
263
280
  .addSection('gemini', `${I18N}.section.gemini.title`, `${I18N}.section.gemini.description`)
264
281
  .addSetting({
265
282
  key: AXPAiManagementSettings.Providers.Gemini.ApiKey,
@@ -278,10 +295,16 @@ class AXMAiManagementSettingProvider {
278
295
  },
279
296
  description: `${I18N}.gemini.api-key.description`,
280
297
  })
281
- .endSection()
282
- .endGroup();
298
+ .endSection();
283
299
  }
284
300
  }
301
+ function provideAiManagementGeminiSettings() {
302
+ return {
303
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
304
+ useClass: AXMAiManagementGeminiSettingProvider,
305
+ multi: true,
306
+ };
307
+ }
285
308
  //#endregion
286
309
 
287
310
  //#region ---- Imports ----
@@ -2486,11 +2509,7 @@ class AXPAiManagerService extends AXPAiAssistService {
2486
2509
  */
2487
2510
  async getEffectiveAssist() {
2488
2511
  const raw = await this.settings.get(AXPAiManagementSettings.DefaultAssistId);
2489
- const assistId = typeof raw === 'string'
2490
- ? raw.trim()
2491
- : raw?.value != null
2492
- ? String(raw.value).trim()
2493
- : '';
2512
+ const assistId = readStoredAssistSettingId(raw);
2494
2513
  if (assistId) {
2495
2514
  const byId = await this.assistData.byKey(assistId);
2496
2515
  if (byId) {
@@ -2683,6 +2702,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
2683
2702
  type: Injectable,
2684
2703
  args: [{ providedIn: 'root' }]
2685
2704
  }] });
2705
+ /** Lookup settings persist an id string, or `{ id }` / `{ value }` before the widget transform. */
2706
+ function readStoredAssistSettingId(raw) {
2707
+ if (typeof raw === 'string') {
2708
+ return raw.trim();
2709
+ }
2710
+ if (raw != null && typeof raw === 'object') {
2711
+ const record = raw;
2712
+ const value = record['id'] ?? record['value'];
2713
+ if (typeof value === 'string') {
2714
+ return value.trim();
2715
+ }
2716
+ }
2717
+ return '';
2718
+ }
2686
2719
 
2687
2720
  //#region ---- Imports ----
2688
2721
  //#endregion
@@ -3744,5 +3777,5 @@ function modelItemSupportsChatCatalogPurpose(m, purpose) {
3744
3777
  * Generated bundle index. Do not edit.
3745
3778
  */
3746
3779
 
3747
- export { AI_CHAT_ATTACHMENT_CATEGORY, AI_CHAT_ATTACHMENT_REF_TYPE, AI_CHAT_GENERATED_IMAGE_REF_TYPE, AI_CHAT_GENERATED_SPEECH_REF_TYPE, AI_CHAT_TTS_PCM_SAMPLE_RATE, AI_GENERATED_IMAGE_MAX_REMOTE_URL_IN_TOOL, AXMAiAssistPromptBoxComponent, AXMAiAssistPromptBoxService, AXMAiManagementMenuProvider, AXMAiManagementModule, AXMPermissionDefinitionProvider, AXPAiAssistChatModelCatalogService, AXPAiAssistDefaultMaxStructuredRetries, AXPAiAssistDefaultStructuredMaxTokens, AXPAiAssistService, AXPAiChatToolRunContextService, AXPAiDefaultModelPickerService, AXPAiEngine, AXPAiManagerService, AXPAiOutputContractResolveService, AXPAiPlatformRuntimeContextBuilder, AXPAiStructuredOutputError, axpAiAssistInitialMessagesToTranscript, axpAiAssistStarterPromptLabels, axpAiAssistStarterPromptTexts, axpAiChatMessageIsDelegatedReflectionExcluded, axpAiChatToolOrAgentResultBodyJson, axpAiChatToolResultBodyJson, axpAiChatUserMessage, axpAiDelegatedAgentOutcomeResponsesPlainText, axpAiDelegatedAgentPromptPreview, axpAiDelegatedAgentResultSegments, axpAiStripAssistInitialHtmlToPlain, axpBuildDelegatedAgentRunInputSnapshot, axpSanitizeLastProviderPayloadForPersistence, axpStripEphemeralStreamChunksFromProviderRaw, blobOrFileFromImageResult, buildStructuredOutputRetryUserText, createBrowserPlayableTtsBlobUrl, extractLastAssistantStructuredParts, getAiChatCommandLlmParametersOverride, isRawPcmMimeType, loadAssistPermissionRows, persistAiChatAttachmentImage, persistAiGeneratedImage, persistAiGeneratedSpeech, prepareTtsBytesForBrowserPlayback, validateAgainstContract, validateJsonSchemaMini, validateStructuredAssistantResponse, wrapPcm16LeInWav };
3780
+ export { AI_CHAT_ATTACHMENT_CATEGORY, AI_CHAT_ATTACHMENT_REF_TYPE, AI_CHAT_GENERATED_IMAGE_REF_TYPE, AI_CHAT_GENERATED_SPEECH_REF_TYPE, AI_CHAT_TTS_PCM_SAMPLE_RATE, AI_GENERATED_IMAGE_MAX_REMOTE_URL_IN_TOOL, AXMAiAssistPromptBoxComponent, AXMAiAssistPromptBoxService, AXMAiManagementMenuProvider, AXMAiManagementModule, AXMPermissionDefinitionProvider, AXPAiAssistChatModelCatalogService, AXPAiAssistDefaultMaxStructuredRetries, AXPAiAssistDefaultStructuredMaxTokens, AXPAiAssistService, AXPAiChatToolRunContextService, AXPAiDefaultModelPickerService, AXPAiEngine, AXPAiManagerService, AXPAiOutputContractResolveService, AXPAiPlatformRuntimeContextBuilder, AXPAiStructuredOutputError, axpAiAssistInitialMessagesToTranscript, axpAiAssistStarterPromptLabels, axpAiAssistStarterPromptTexts, axpAiChatMessageIsDelegatedReflectionExcluded, axpAiChatToolOrAgentResultBodyJson, axpAiChatToolResultBodyJson, axpAiChatUserMessage, axpAiDelegatedAgentOutcomeResponsesPlainText, axpAiDelegatedAgentPromptPreview, axpAiDelegatedAgentResultSegments, axpAiStripAssistInitialHtmlToPlain, axpBuildDelegatedAgentRunInputSnapshot, axpSanitizeLastProviderPayloadForPersistence, axpStripEphemeralStreamChunksFromProviderRaw, blobOrFileFromImageResult, buildStructuredOutputRetryUserText, createBrowserPlayableTtsBlobUrl, extractLastAssistantStructuredParts, getAiChatCommandLlmParametersOverride, isRawPcmMimeType, loadAssistPermissionRows, persistAiChatAttachmentImage, persistAiGeneratedImage, persistAiGeneratedSpeech, prepareTtsBytesForBrowserPlayback, provideAiManagementGeminiSettings, validateAgainstContract, validateJsonSchemaMini, validateStructuredAssistantResponse, wrapPcm16LeInWav };
3748
3781
  //# sourceMappingURL=acorex-platform-module-ai-management-client.mjs.map