wuic-framework-lib 1.2.1 → 1.3.2

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.
Files changed (16) hide show
  1. package/fesm2022/{wuic-framework-lib-chart-list.component-B1V8Q-Qq.mjs → wuic-framework-lib-chart-list.component-DAP-TPJR.mjs} +2 -2
  2. package/fesm2022/{wuic-framework-lib-code-editor.component-4N95qt3D.mjs → wuic-framework-lib-code-editor.component-CLMDvOWs.mjs} +59 -2
  3. package/fesm2022/{wuic-framework-lib-designer.component-pW1YK-oY.mjs → wuic-framework-lib-designer.component-DA7abiLW.mjs} +1063 -18
  4. package/fesm2022/{wuic-framework-lib-first-run-wizard.component-CaGePYLi.mjs → wuic-framework-lib-first-run-wizard.component-BLrUrfZ9.mjs} +83 -97
  5. package/fesm2022/{wuic-framework-lib-framework-docs.component-m0IlS0Sl.mjs → wuic-framework-lib-framework-docs.component-DphKhTef.mjs} +3733 -344
  6. package/fesm2022/{wuic-framework-lib-pivot-builder.component-VIs0CIH_.mjs → wuic-framework-lib-pivot-builder.component-BqUUwrJM.mjs} +5 -5
  7. package/fesm2022/{wuic-framework-lib-prompt-dialog-fallback-host.component-Dm9GTZ07.mjs → wuic-framework-lib-prompt-dialog-fallback-host.component-DZrhwMH5.mjs} +2 -2
  8. package/fesm2022/{wuic-framework-lib-report-designer.component-FiAwNkPM.mjs → wuic-framework-lib-report-designer.component-D_qbefud.mjs} +2 -2
  9. package/fesm2022/{wuic-framework-lib-report-viewer.component-DY0dGMrt.mjs → wuic-framework-lib-report-viewer.component-CIN2fY0P.mjs} +2 -2
  10. package/fesm2022/{wuic-framework-lib-scheduler-list.component-3E5m-9Qd.mjs → wuic-framework-lib-scheduler-list.component-CdcI1Uor.mjs} +2 -2
  11. package/fesm2022/{wuic-framework-lib-spreadsheet-list-sf.component-D9P9WbDl.mjs → wuic-framework-lib-spreadsheet-list-sf.component-j1HTRI_P.mjs} +2 -2
  12. package/fesm2022/{wuic-framework-lib-workflow-designer.component-4RC2EkGA.mjs → wuic-framework-lib-workflow-designer.component-SE_7ZogW.mjs} +2 -2
  13. package/fesm2022/{wuic-framework-lib-wuic-framework-lib-BSyGhpM1.mjs → wuic-framework-lib-wuic-framework-lib-BRujEwpR.mjs} +2252 -156
  14. package/fesm2022/wuic-framework-lib.mjs +1 -1
  15. package/package.json +1 -1
  16. package/types/wuic-framework-lib.d.ts +852 -13
@@ -3,7 +3,7 @@ import { ErrorHandler, Injector, OnInit, OnDestroy, ChangeDetectorRef, NgZone, A
3
3
  import * as rxjs from 'rxjs';
4
4
  import { BehaviorSubject, Subject, Observable } from 'rxjs';
5
5
  import { MenuItem, MessageService, ConfirmationService, Confirmation, TreeNode, MegaMenuItem } from 'primeng/api';
6
- import { HttpClient, HttpInterceptorFn, HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';
6
+ import { HttpClient, HttpInterceptorFn, HttpContextToken, HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';
7
7
  import { Router, ActivatedRoute, CanDeactivateFn, CanActivateFn, CanMatchFn, Routes } from '@angular/router';
8
8
  import * as _ngx_translate_core from '@ngx-translate/core';
9
9
  import { TranslateService } from '@ngx-translate/core';
@@ -594,6 +594,15 @@ declare class TranslationManagerService {
594
594
  * del missing key).
595
595
  */
596
596
  private _langMismatchReloadInFlight;
597
+ /**
598
+ * Ultimo locale risolto in modo AFFIDABILE (da override localStorage o da
599
+ * `userInfo`). Usato come fallback stabile in `resolveCurrentLocale()` quando
600
+ * `getuserInfo()` torna momentaneamente vuoto (succede durante navigazione/
601
+ * edit/reload metadata): senza, il locale driftarebbe a `navigator.language`/
602
+ * default, cambiando la `translationCacheKey` e innescando il self-heal che
603
+ * faceva sparire le traduzioni fino al refresh.
604
+ */
605
+ private _stableLocale;
597
606
  /**
598
607
  * Bundle minimo di traduzioni hardcoded per il SOLO scenario firstRun (DB
599
608
  * metadati ancora non inizializzato → tabella `_wuic_translations` non
@@ -1160,9 +1169,17 @@ declare class DataSourceComponent implements OnInit, OnDestroy {
1160
1169
  * DI) invece che da costruttore per non rompere i call site manuali tipo
1161
1170
  * `new DataSourceComponent(metaSrv, dataSrv, ...)` in designer.component.ts
1162
1171
  * e metadata-editor.service.ts (che mantengono i 7 params posizionali storici).
1163
- * `{ optional: true }` rende il field null fuori da un Angular DI context
1164
- * (es. unit test che istanziano la classe a mano) — il consumo in ngOnInit
1165
- * usa `?.nativeElement` per sopportare entrambi i path.
1172
+ *
1173
+ * ATTENZIONE: `{ optional: true }` rende il field `null` solo se il TOKEN non e'
1174
+ * risolvibile, NON quando si e' fuori da un injection context. Fuori contesto
1175
+ * (istanziazione manuale via `new`, es. metadata-editor.service che crea un
1176
+ * DataSource headless per fetch schema/dati) `inject()` lancia SEMPRE `NG0203`
1177
+ * a prescindere da `optional`. Per questo lo avvolgiamo in try/catch: nel path
1178
+ * Angular normale ritorna l'ElementRef host; nei call site manuali ritorna
1179
+ * `null` (il consumo in ngOnInit usa `?.nativeElement`, quindi entrambi i path
1180
+ * sono supportati). Senza questo guard, un doppio-click su una label del
1181
+ * parametric dialog (che passa per metadata-editor.service -> `new DataSource`)
1182
+ * crashava con NG0203.
1166
1183
  * Scopo: esporre `this` su `host.__wuicCmp` per E2E introspection senza
1167
1184
  * dipendere da `window.ng.getComponent` (tree-shaken in prod build).
1168
1185
  */
@@ -1514,6 +1531,31 @@ declare class DataSourceComponent implements OnInit, OnDestroy {
1514
1531
  * Svuota la selezione locale delle righe.
1515
1532
  */
1516
1533
  clearSelectedRows(): void;
1534
+ /**
1535
+ * Ritorna i record correntemente selezionati nella `<wuic-list-grid>` (checkbox
1536
+ * di selezione multipla). Usato nelle **toolbar action bulk** per recuperare le
1537
+ * righe su cui agire prima di chiamare un endpoint server.
1538
+ *
1539
+ * Forma canonica nei callback (firma `(datasource, metaInfo, record, event, wtoolbox)`):
1540
+ * ```js
1541
+ * const selected = (datasource.getSelectedRows && datasource.getSelectedRows()) || [];
1542
+ * if (!selected.length) {
1543
+ * wtoolbox.messageNotificationService.add({ severity:'warn', summary:'Selezione vuota', detail:'Seleziona almeno una riga' });
1544
+ * return;
1545
+ * }
1546
+ * const ids = selected.map(r => Number(r.id?.value ?? r.id ?? r.Id));
1547
+ * ```
1548
+ *
1549
+ * **Importante**: il parametro `record` passato al callback toolbar è un SINGOLO
1550
+ * record (la riga "corrente"), NON l'array dei selezionati. Per il bulk usare
1551
+ * SEMPRE `datasource.getSelectedRows()` (oggetti completi) o
1552
+ * `datasource.getSelectedKeys()` (solo PK).
1553
+ *
1554
+ * Pre-requisito: la tabella deve avere `mdmultipleselection=1` su
1555
+ * `_metadati__tabelle` (vedi skill `table-actions`).
1556
+ *
1557
+ * @returns Array di record selezionati (vuoto se nulla e' selezionato).
1558
+ */
1517
1559
  getSelectedRows(): any[];
1518
1560
  /**
1519
1561
  * Estrae dalla selezione i valori della chiave primaria; per PK composta restituisce un oggetto per riga.
@@ -2993,6 +3035,32 @@ declare class MetadataProviderService {
2993
3035
  * @param userId Identificativo utente usato per contesto e persistenza.
2994
3036
  */
2995
3037
  private clearMenuAdminMethodsCache;
3038
+ /**
3039
+ * Cancella dalla Dexie locale SOLO i record collegati alla route data, lasciando
3040
+ * intatto il resto del database multi-tenant. Necessario dopo che un'operazione
3041
+ * server-side (es. RAG chatbot Apply, metadata-editor save) modifica i metadati
3042
+ * di una singola route senza invalidare l'intera cache: chiamare
3043
+ * <c>Dexie.delete()</c> per tutto il DB causa una riapertura completa al primo
3044
+ * F5 (costosa: ~MB di re-fetch dal backend per le route che non hanno cambiato);
3045
+ * con questo metodo si esegue un flush mirato sulle 7 tabelle Dexie correlate.
3046
+ *
3047
+ * Tabelle gestite (vedi <c>generateLocalDB</c>):
3048
+ * - MetadatiTabella (filter: md_route_name)
3049
+ * - MetadatiColonna (filter: md_id derivato)
3050
+ * - MetadatiCustomActionTabella (filter: md_id)
3051
+ * - MetadatiUiStiliTabella (filter: md_id)
3052
+ * - MetadatiUiStiliColonna (filter: mc_id ∈ colonne della route)
3053
+ * - MetadatiUtentiAutorizzazioniColonna (filter: mc_id ∈ colonne della route)
3054
+ * - MetadatiConditionGroup (filter: md_id)
3055
+ *
3056
+ * No-op se: route vuota, Dexie non inizializzata, o la route non e' presente in
3057
+ * cache (gia' "lazy" - verra' fetched dal backend al primo accesso).
3058
+ * Best-effort: errori dei singoli delete non bloccano gli altri.
3059
+ *
3060
+ * @param route Nome route metadata (es. "cities", "stockitems") — corrisponde
3061
+ * a <c>MetadatiTabella.md_route_name</c>.
3062
+ */
3063
+ static deleteRouteFromCache(route: string): Promise<void>;
2996
3064
  /**
2997
3065
  * Invalida la cache menu dell'utente corrente (o dell'utente passato) rimuovendo la voce `menu_{userId}` da localStorage.
2998
3066
  * Se richiesto elimina anche la cache dei metodi amministrativi `menu_admin_methods_{userId}`.
@@ -3007,6 +3075,32 @@ declare class MetadataProviderService {
3007
3075
  * @returns Collezione metadata colonna della tabella richiesta.
3008
3076
  */
3009
3077
  getMetadatiById(md_id: number): Promise<MetadatiColonna[]>;
3078
+ private static _availableRoutesCache;
3079
+ private static _availableRoutesInflight;
3080
+ /**
3081
+ * Lista delle route metadata utente (md_route_name + md_display_string).
3082
+ * Backend: `MetaService.getAvailableRoutes` (admin-only, cached server-side).
3083
+ *
3084
+ * Idempotente + de-duplicato in-flight: chiamate concorrenti condividono
3085
+ * la stessa Promise per evitare race.
3086
+ *
3087
+ * Usata dal chatbot RAG (designer state provider) per:
3088
+ * 1) fornire al LLM la whitelist di route valide,
3089
+ * 2) permettere fuzzy-match semantico ("provincie" -> "provinces"),
3090
+ * 3) fare follow-up question quando l'utente menziona una route ambigua.
3091
+ */
3092
+ getAvailableRoutesAsync(): Promise<Array<{
3093
+ md_id: number;
3094
+ md_route_name: string;
3095
+ md_display_string: string;
3096
+ }>>;
3097
+ /**
3098
+ * Invalida la cache process-wide delle route disponibili. Chiamare dopo
3099
+ * scaffolding (crea/elimina route) per forzare un re-fetch al prossimo
3100
+ * accesso. La cache server-side va invalidata separatamente (boot di
3101
+ * un nuovo worker o gesture esplicita).
3102
+ */
3103
+ clearAvailableRoutesCache(): void;
3010
3104
  /**
3011
3105
  * Restituisce i metadata di una route (o `md_id`) da cache Dexie quando validi; in caso contrario ricarica da backend.
3012
3106
  * Gestisce invalidazione per versioning metadata progetto e bypass cache in modalita client-side CRUD.
@@ -3596,8 +3690,10 @@ declare class DataProviderMetaService {
3596
3690
  */
3597
3691
  private buildStoredParametersPayload;
3598
3692
  /**
3599
- * Pulisce la cache localStorage preservando le traduzioni gia caricate.
3600
- * Evita regressioni UX dove, dopo save metadata non-translation, le label tornano alle chiavi raw.
3693
+ * Pulisce la cache localStorage preservando le chiavi user-state della
3694
+ * whitelist centralizzata in `util/wuic-storage.util.ts` (translation cache,
3695
+ * id sessione chatbot RAG, preferenze tema/lingua, ecc.). Vedi i commenti in
3696
+ * quel file per la lista completa e il razionale.
3601
3697
  */
3602
3698
  private clearLocalStoragePreservingTranslation;
3603
3699
  private buildRouteContext;
@@ -6225,6 +6321,9 @@ declare class ListGridComponent implements AfterViewInit, OnInit, OnDestroy, IDa
6225
6321
  private releaseGridStateUrlPushTimer;
6226
6322
  private navigationTriggeredByPopstate;
6227
6323
  private suppressNextPageOnlyQuerySync;
6324
+ private pendingFilterChangeEvent;
6325
+ private pendingFilterChangeTimer;
6326
+ private lastFetchedPayloadHash;
6228
6327
  clientSideCrudToggleBusy: boolean;
6229
6328
  private persistedColumnWidthsByRoute;
6230
6329
  private persistedColumnLayoutByRoute;
@@ -6658,6 +6757,12 @@ declare class ListGridComponent implements AfterViewInit, OnInit, OnDestroy, IDa
6658
6757
  * @returns Risultato elaborato da `pageFilterChange` e restituito al chiamante.
6659
6758
  */
6660
6759
  pageFilterChange(event: any): Promise<void>;
6760
+ /**
6761
+ * Processore reale dell'evento PrimeNG (sort/filter/paging). Chiamato
6762
+ * tail-call da `pageFilterChange` via setTimeout(0) per coalesce.
6763
+ * NON chiamare direttamente: la coalesce e' la guard anti-duplicate-fetch.
6764
+ */
6765
+ private _processPageFilterEvent;
6661
6766
  /**
6662
6767
  * Gestisce la logica operativa di `clearFilter` in modo coerente con l'implementazione corrente.
6663
6768
  * @param table Parametro utilizzato dal metodo nel flusso elaborativo.
@@ -9951,6 +10056,12 @@ interface AppSettingFieldDef {
9951
10056
  * user can't accidentally write `mssqll` and brick the next backend boot.
9952
10057
  */
9953
10058
  options?: string[] | null;
10059
+ /** Se valorizzato, le `options` sono DINAMICHE: vengono fetchate da questo endpoint
10060
+ * (relativo, es. `api/AppSettings/LlmModels`) passando il valore del campo
10061
+ * `optionsDependsOn` come query param omonimo. Re-fetch al cambio di quel campo. */
10062
+ optionsEndpoint?: string | null;
10063
+ /** Key (senza prefisso `AppSettings:`) del campo da cui dipendono le options dinamiche. */
10064
+ optionsDependsOn?: string | null;
9954
10065
  }
9955
10066
  interface AppSettingSection {
9956
10067
  name: string;
@@ -10033,6 +10144,14 @@ declare class AppSettingsEditorComponent implements OnInit {
10033
10144
  */
10034
10145
  onFieldChange(key: string, newValue: any): void;
10035
10146
  fieldValue(key: string): any;
10147
+ /** Per ogni field con `optionsEndpoint`, fetcha le options usando il valore corrente
10148
+ * del campo `optionsDependsOn`. Chiamato dopo ogni loadSchema. */
10149
+ private refreshDynamicOptions;
10150
+ /** Valore corrente del campo identificato da `dependsOnKey` (con/senza prefisso AppSettings:). */
10151
+ private dependsOnValue;
10152
+ /** GET `<endpoint>?<dependsOn>=<depVal>` -> popola `f.options`. Best-effort: su errore
10153
+ * lascia il campo come testo libero (options resta vuoto). */
10154
+ private fetchFieldOptions;
10036
10155
  /**
10037
10156
  * Ritorna `true` se almeno uno dei changes coinvolge una chiave licenza
10038
10157
  * (`license-email` / `license-payload` / `license-signature`). Usato dal save
@@ -12428,6 +12547,17 @@ declare class DynamicRowTemplateComponent {
12428
12547
  * Gestisce la logica operativa di `classes` usando metadati di tabella/colonna allineati al modello server `_Metadati_*`.
12429
12548
  * @returns Valore calcolato dinamicamente a partire dallo stato corrente del componente.
12430
12549
  */
12550
+ /**
12551
+ * Inline style cumulativo applicato alla `<tr>` quando una entry di
12552
+ * `_metadati__u_i__stili__tabelle` ha `must_attribute_name` con prefisso `style:`
12553
+ * (es. `style:background-color:#9b59b6;color:white`). Permette al chatbot RAG
12554
+ * (tool `propose_table_style`) di proporre colori arbitrari fuori dalla palette
12555
+ * predefinita (`row-danger/warning/info/success`) senza dover aggiungere CSS
12556
+ * lato app. Sintassi: prefisso `style:` letterale + dichiarazioni standard CSS
12557
+ * separate da `;`. Backwards-compatible: entries senza prefisso `style:` restano
12558
+ * trattate come classe CSS (vedi `getTableStyleClasses`).
12559
+ */
12560
+ get inlineStyle(): string | null;
12431
12561
  get classes(): string | null;
12432
12562
  /**
12433
12563
  * Recupera e prepara i dati richiesti dal chiamante normalizzando e trasformando collezioni di record, usando i metadati per determinare campi, chiavi e comportamento runtime, allineando i record al formato atteso dal framework.
@@ -12435,6 +12565,16 @@ declare class DynamicRowTemplateComponent {
12435
12565
  */
12436
12566
  private getTableStyleClasses;
12437
12567
  /**
12568
+ * Inline-style speculare a `getTableStyleClasses`. Filtra le entries di
12569
+ * `_Metadati_UI_Stili_Tabelles` il cui `must_attribute_name` ha prefisso
12570
+ * `style:` letterale; valuta il predicate (`must_attribute_value`) con
12571
+ * stessa semantica e stessa cache (skip su throw); concatena le dichiarazioni
12572
+ * CSS in una stringa unica idonea all'attributo HTML `style`. Restituisce
12573
+ * `null` se nessuna entry matcha — Angular rimuove l'attributo, lasciando
12574
+ * intatto eventuale styling dal CSS.
12575
+ */
12576
+ private getTableInlineStyle;
12577
+ /**
12438
12578
  * Costruisce una struttura di output a partire dal contesto corrente usando i metadati per determinare campi, chiavi e comportamento runtime, allineando i record al formato atteso dal framework.
12439
12579
  * @param conditionCode Valore testuale usato come chiave, campo, route o parametro di configurazione.
12440
12580
  * @returns Valore di tipo `(metaInfo: MetaInfo, record: any, wtoolbox: typeof WtoolboxService) => boolean` costruito dal metodo per i passaggi successivi del flusso.
@@ -12448,6 +12588,17 @@ declare class DynamicRowTemplateComponent {
12448
12588
  */
12449
12589
  getCellClasses(metaColumn: any, rowData: any): string | null;
12450
12590
  /**
12591
+ * Inline-style speculare a `getCellInlineStyle` per le celle. Filtra le
12592
+ * entries di `_Metadati_UI_Stili_Colonnes` il cui `musc_attribute_name` ha
12593
+ * prefisso `style:`; valuta il predicate (`musc_attribute_value` o
12594
+ * `musc_attribute_value_callback`) e concatena le dichiarazioni CSS in una
12595
+ * stringa unica idonea all'attributo HTML `style`. Iniezione automatica di
12596
+ * `!important` su ogni dichiarazione che non ce l'ha gia' (PrimeNG p-table
12597
+ * applica `background` ai td via regole con `!important` per striped/hover —
12598
+ * senza, l'inline style perderebbe la specificity).
12599
+ */
12600
+ getCellInlineStyle(metaColumn: any, rowData: any): string | null;
12601
+ /**
12451
12602
  * Recupera e prepara i dati richiesti dal chiamante usando i metadati per determinare campi, chiavi e comportamento runtime.
12452
12603
  * @param fieldName Valore testuale usato come chiave, campo, route o parametro di configurazione.
12453
12604
  * @returns Valore di tipo `MetadatiColonna | null` costruito dal metodo per i passaggi successivi del flusso.
@@ -13066,6 +13217,14 @@ declare class NotificationBellComponent implements OnInit, OnDestroy {
13066
13217
  private resolveLabels;
13067
13218
  ngOnInit(): Promise<void>;
13068
13219
  ngOnDestroy(): void;
13220
+ /**
13221
+ * True per le notifiche "interne" del chatbot RAG (`rag.message.ready` /
13222
+ * `rag.message.error`): NON sono voci utente del campanello, ma segnali che il
13223
+ * componente chatbot usa per refreshare il messaggio in chat. Il bell le esclude
13224
+ * da lista e badge; le `rag.engine.bootstrap.*` (started/ready/error) restano
13225
+ * perche' sono feedback utente reale (download modelli in corso/pronto).
13226
+ */
13227
+ private isChatbotInternalNotification;
13069
13228
  clearRead(): Promise<void>;
13070
13229
  markAllRead(): Promise<void>;
13071
13230
  /**
@@ -14181,11 +14340,15 @@ interface RagChatTurn {
14181
14340
  role: 'user' | 'assistant';
14182
14341
  content: string;
14183
14342
  }
14343
+ /** Profilo redazione richiesto dall'UI (toggle). Il server applica
14344
+ * strictest-of(env, richiesta): puo' solo aumentare la redazione. */
14345
+ type RagProfile = 'internal' | 'release';
14184
14346
  /** Payload `POST /api/Rag/Query`. */
14185
14347
  interface RagQueryRequest {
14186
14348
  query: string;
14187
14349
  top_k?: number;
14188
14350
  use_lora?: boolean;
14351
+ profile?: RagProfile;
14189
14352
  }
14190
14353
  /** Risposta `POST /api/Rag/Query`. */
14191
14354
  interface RagQueryResponse {
@@ -14197,6 +14360,7 @@ interface RagChatRequest {
14197
14360
  history?: RagChatTurn[];
14198
14361
  top_k?: number;
14199
14362
  model?: string;
14363
+ profile?: RagProfile;
14200
14364
  }
14201
14365
  /**
14202
14366
  * Risposta `POST /api/Rag/Chat`.
@@ -14232,6 +14396,14 @@ interface RagChatSessionDto {
14232
14396
  title?: string | null;
14233
14397
  createdAt: string;
14234
14398
  updatedAt: string;
14399
+ /** Riassunto dei turn pre-compact (iniettato nel system prompt LLM). Null
14400
+ * finche' la session non e' mai stata compattata. */
14401
+ contextSummary?: string | null;
14402
+ /** JSON array dei memory facts pinnati. Null/[] = nessun fact pinnato. */
14403
+ memoryFactsJson?: string | null;
14404
+ /** Marker: turn con `id <= summaryUpToMessageId` sono coperti dal `contextSummary`
14405
+ * e vengono trim-mati dalla history passata al LLM. */
14406
+ summaryUpToMessageId?: number | null;
14235
14407
  }
14236
14408
  /** Un messaggio (turno) della cronologia. */
14237
14409
  interface RagChatMessageDto {
@@ -14249,6 +14421,123 @@ interface RagChatMessageDto {
14249
14421
  correlationId: string;
14250
14422
  createdAt: string;
14251
14423
  completedAt?: string | null;
14424
+ /** JSON serializzato della proposta strutturata emessa dall'LLM via tool-use.
14425
+ * Forma: {"kind":"toolbar_action","route":"cities","label":"Genera PDF",
14426
+ * "icon":"pi pi-file-pdf","callback_js":"...","rationale":"..."}.
14427
+ * Null = nessuna proposta (risposta solo testo). */
14428
+ proposedActionJson?: string | null;
14429
+ /** Timestamp UTC dell'applicazione della proposta. Null = mai applicata. */
14430
+ proposedActionAppliedAt?: string | null;
14431
+ /** JSON array di follow-up question (max 3) emesse dall'LLM via tool
14432
+ * `suggest_followups`. Renderizzate come chip cliccabili sotto la risposta;
14433
+ * click su un chip popola l'input box (non invia automaticamente). */
14434
+ followupQuestionsJson?: string | null;
14435
+ /** Token consumati dalla call Anthropic per questo turn (driver del cerchio cue). */
14436
+ contextUsedTokens?: number | null;
14437
+ /** Context window max del modello al momento del turn (es. 200000 per Haiku). */
14438
+ contextWindowMax?: number | null;
14439
+ }
14440
+ /** Forma deserializzata della proposta. Il client deve gestire SOLO i `kind` che
14441
+ * conosce — futuro-proof: gli sconosciuti vengono mostrati come "azione non
14442
+ * supportata da questa versione del client". */
14443
+ type RagProposedActionKind = 'toolbar_action' | 'row_action' | 'table_style' | 'column_style' | 'display_formula' | 'form_title_formula' | 'default_value_callback' | 'custom_validation' | 'selection_changed' | 'lifecycle_callback' | 'simple_metadata_update'
14444
+ /**
14445
+ * Iniezione di componenti nel canvas del dashboard designer.
14446
+ *
14447
+ * NB: kind CLIENT-ONLY - NON viene applicato dal backend
14448
+ * `RagController.ApplyAction` ma da un handler registrato dal
14449
+ * designer.component via `ChatbotHostRegistryService`. Vedi
14450
+ * docs/pages/_internal/designer-tool-catalog.md per il catalogo
14451
+ * dei tool palette disponibili + constraint.
14452
+ *
14453
+ * Payload: `{ kind, layout: [{tool_name, inputs?, parent_unique_name?, children?}, ...], rationale }`.
14454
+ * Il chatbot popover bypassa `/api/Rag/ApplyAction` quando il
14455
+ * registry ha un handler per questo kind.
14456
+ */
14457
+ | 'designer_inject'
14458
+ /**
14459
+ * Scrittura di uno snippet SQL in un campo metadata D3 (super-admin).
14460
+ * Campi gated da `Helpers.SqlFragmentMetadataFields`:
14461
+ * `md_join_override`, `mc_custom_select_clause`, `mc_custom_join`,
14462
+ * `mc_computed_formula`, `mc_ui_lookup_computed_dataTextField`.
14463
+ *
14464
+ * Backend-applied via `RagController.ApplySqlMetadataField` con D3 RBAC
14465
+ * gate (`AssertCanWriteSqlFragmentFields`) + audit log su `_error__logs`.
14466
+ * Payload: `{kind, target_table, target_row_key:{route, column_name?},
14467
+ * field_name, sql_snippet, dbms_target, rationale}`.
14468
+ */
14469
+ | 'sql_metadata_field'
14470
+ /**
14471
+ * Creazione di una nuova riga in `_metadati__colonne` (colonna fisica o
14472
+ * calcolata). Step 1 del workflow per colonne calcolate (step 2 = `sql_metadata_field`
14473
+ * con `mc_computed_formula`). Backend-applied via
14474
+ * `RagController.ApplyMetadataColumnCreate` + audit log `_error__logs`.
14475
+ * Payload: `{kind, route, column_name, display_string, ui_column_type,
14476
+ * is_computed, real_column_name?, rationale}`.
14477
+ */
14478
+ | 'metadata_column_create';
14479
+ interface RagProposedAction {
14480
+ kind: RagProposedActionKind | string;
14481
+ route?: string;
14482
+ label?: string;
14483
+ icon?: string;
14484
+ callback_js?: string;
14485
+ rationale?: string;
14486
+ /**
14487
+ * Solo per `kind === 'toolbar_action'`. True quando il callback opera sulla
14488
+ * SELEZIONE corrente (bulk delete/archive/export/update via
14489
+ * `datasource.getSelectedRows()`). All'apply, il backend abilita
14490
+ * `md_multiple_selection` sulla route se non gia' attivo (le checkbox di
14491
+ * selezione riga compaiono in UI). Omettere significa false.
14492
+ */
14493
+ requires_multi_selection?: boolean;
14494
+ [key: string]: any;
14495
+ }
14496
+ /** Payload `POST /api/Rag/ApplyAction`. */
14497
+ interface RagApplyActionRequest {
14498
+ messageId: number;
14499
+ }
14500
+ /** Payload `POST /api/Rag/UpdateProposedAction`. Usato quando l'utente edita
14501
+ * la classe/stile o il callback nell'UI prima del click "Applica" — il
14502
+ * componente invia il payload completo e il backend sovrascrive
14503
+ * `proposed_action_json` (filtri ownership + non-applicata). */
14504
+ interface RagUpdateProposedActionRequest {
14505
+ messageId: number;
14506
+ proposedAction: RagProposedAction;
14507
+ }
14508
+ interface RagUpdateProposedActionResponse {
14509
+ ok: boolean;
14510
+ error?: string;
14511
+ maxBytes?: number;
14512
+ }
14513
+ interface RagApplyActionResponse {
14514
+ ok: boolean;
14515
+ kind?: string;
14516
+ projectMetadataVersion?: string;
14517
+ error?: string;
14518
+ detail?: string;
14519
+ }
14520
+ /** Payload `POST /api/Rag/Compact`. */
14521
+ interface RagCompactRequest {
14522
+ sessionId: number;
14523
+ }
14524
+ interface RagCompactResponse {
14525
+ ok?: boolean;
14526
+ noop?: boolean;
14527
+ summaryUpToMessageId?: number;
14528
+ summaryLength?: number;
14529
+ error?: string;
14530
+ reason?: string;
14531
+ }
14532
+ /** Payload `POST /api/Rag/RenameSession`. */
14533
+ interface RagRenameSessionRequest {
14534
+ sessionId: number;
14535
+ title: string;
14536
+ }
14537
+ interface RagRenameSessionResponse {
14538
+ ok?: boolean;
14539
+ title?: string;
14540
+ error?: string;
14252
14541
  }
14253
14542
  /** Snapshot history completo (sessione + messaggi ordine cronologico). */
14254
14543
  interface RagChatHistorySnapshot {
@@ -14264,6 +14553,17 @@ interface RagAskRequest {
14264
14553
  mode?: 'auto' | 'chat' | 'retrieval';
14265
14554
  topK?: number;
14266
14555
  model?: string;
14556
+ /** Profilo redazione dal toggle UI (strictest-of lato server). */
14557
+ profile?: RagProfile;
14558
+ /**
14559
+ * Contesto della pagina dell'utente (route, tabella metadata, colonne, eventuali
14560
+ * route correlate). Iniettato dal lato client al momento del send: permette
14561
+ * all'LLM di generare snippet che usano i nomi REALI delle colonne (es.
14562
+ * `record.CityName.value`) invece di placeholder generici, e di referenziare
14563
+ * la route effettiva. Niente effetto se vuoto. Costruito da
14564
+ * `WuicRagChatbotComponent.buildRouteContext()`.
14565
+ */
14566
+ routeContext?: string | null;
14267
14567
  }
14268
14568
  /** Risposta `POST /api/Rag/Ask` - ritornato SUBITO, prima del completamento. */
14269
14569
  interface RagAskAcceptedResponse {
@@ -14294,11 +14594,13 @@ declare class WuicRagService {
14294
14594
  query(query: string, options?: {
14295
14595
  topK?: number;
14296
14596
  useLora?: boolean;
14597
+ profile?: RagProfile;
14297
14598
  }): Observable<RagQueryResponse>;
14298
14599
  /** Variant Promise di {@link query}. */
14299
14600
  queryAsync(query: string, options?: {
14300
14601
  topK?: number;
14301
14602
  useLora?: boolean;
14603
+ profile?: RagProfile;
14302
14604
  }): Promise<RagQueryResponse>;
14303
14605
  /**
14304
14606
  * Esegue una chat completa (RAG + Claude). Se il server non ha
@@ -14312,11 +14614,13 @@ declare class WuicRagService {
14312
14614
  chat(query: string, history?: RagChatTurn[], options?: {
14313
14615
  topK?: number;
14314
14616
  model?: string;
14617
+ profile?: RagProfile;
14315
14618
  }): Observable<RagChatResponse>;
14316
14619
  /** Variant Promise di {@link chat}. */
14317
14620
  chatAsync(query: string, history?: RagChatTurn[], options?: {
14318
14621
  topK?: number;
14319
14622
  model?: string;
14623
+ profile?: RagProfile;
14320
14624
  }): Promise<RagChatResponse>;
14321
14625
  /**
14322
14626
  * Stato del server RAG (status, LLM enabled, chunks indicizzati).
@@ -14380,6 +14684,39 @@ declare class WuicRagService {
14380
14684
  */
14381
14685
  ask(req: RagAskRequest): Observable<RagAskAcceptedResponse>;
14382
14686
  askAsync(req: RagAskRequest): Promise<RagAskAcceptedResponse>;
14687
+ /**
14688
+ * Applica la proposta d'azione precedentemente emessa dall'LLM sul messaggio
14689
+ * indicato. Server-side: re-legge la `proposed_action_json` dal DB (non dal
14690
+ * client: prevenzione tampering del `callback_js`), valida, fa INSERT sul
14691
+ * metadata corrispondente + `InvalidateMetadataCachesAndSetVersion`.
14692
+ *
14693
+ * Gating: solo `isSuperAdmin` (server torna `403 admin-required` in caso).
14694
+ * Esiti tipici (`error`): `not-authenticated` | `admin-required` |
14695
+ * `message-not-found` | `no-proposed-action-on-message` | `already-applied` |
14696
+ * `unsupported-kind: <x>` | `apply-failed`.
14697
+ */
14698
+ applyProposedAction(req: RagApplyActionRequest): Observable<RagApplyActionResponse>;
14699
+ applyProposedActionAsync(req: RagApplyActionRequest): Promise<RagApplyActionResponse>;
14700
+ /**
14701
+ * Sovrascrive il `proposed_action_json` di un messaggio assistant con il
14702
+ * payload editato dall'utente in UI (campo "Classe/Stile" + textarea callback).
14703
+ * Va chiamato PRIMA di `applyProposedActionAsync` quando l'utente modifica
14704
+ * qualcosa, cosi' che il backend ApplyAction rilegga dal DB il payload giusto.
14705
+ * Filtri di sicurezza nel backend: ownership user_id + non gia' applicata.
14706
+ */
14707
+ updateProposedAction(req: RagUpdateProposedActionRequest): Observable<RagUpdateProposedActionResponse>;
14708
+ updateProposedActionAsync(req: RagUpdateProposedActionRequest): Promise<RagUpdateProposedActionResponse>;
14709
+ /**
14710
+ * Compatta la sessione: chiama il backend che a sua volta chiama il rag_server
14711
+ * per produrre un summary della history. Persiste su `_rag_chat_sessions`
14712
+ * + avanza `summary_up_to_message_id`. Le future call /Ask passeranno il
14713
+ * summary nel system prompt al posto dei turn coperti.
14714
+ */
14715
+ compactSession(req: RagCompactRequest): Observable<RagCompactResponse>;
14716
+ compactSessionAsync(req: RagCompactRequest): Promise<RagCompactResponse>;
14717
+ /** Rinomina il titolo di una session (mostrato nella sessions list). */
14718
+ renameSession(req: RagRenameSessionRequest): Observable<RagRenameSessionResponse>;
14719
+ renameSessionAsync(req: RagRenameSessionRequest): Promise<RagRenameSessionResponse>;
14383
14720
  /**
14384
14721
  * Costruisce l'URL `<api_base>Rag/<action>` rispettando l'eventuale
14385
14722
  * `WtoolboxService.appSettings.api_url` configurato lato runtime (stesso
@@ -14391,6 +14728,147 @@ declare class WuicRagService {
14391
14728
  static ɵprov: i0.ɵɵInjectableDeclaration<WuicRagService>;
14392
14729
  }
14393
14730
 
14731
+ /**
14732
+ * Esito ritornato da un host action handler. Il chatbot lo mostra come toast
14733
+ * (success se ok=true, error altrimenti). `message` e' opzionale.
14734
+ */
14735
+ interface ChatbotHostActionResult {
14736
+ ok: boolean;
14737
+ message?: string;
14738
+ }
14739
+ /**
14740
+ * Signature del callback che un componente "host" (es. designer.component)
14741
+ * registra per ricevere le proposed_action_json di kind client-only
14742
+ * (es. 'designer_inject') invece di farle passare dal backend
14743
+ * `/api/Rag/ApplyAction`.
14744
+ *
14745
+ * Il handler DEVE essere async (o ritornare una Promise) cosi' il chatbot
14746
+ * puo' aspettare l'esito prima di marcare il turn come applicato e
14747
+ * mostrare il toast.
14748
+ */
14749
+ type ChatbotHostActionHandler = (action: RagProposedAction) => Promise<ChatbotHostActionResult>;
14750
+ /**
14751
+ * Singleton (providedIn:'root') che propaga un `ChatbotHostActionHandler`
14752
+ * dal componente host (es. designer.component) al chatbot popover globale
14753
+ * (`<wuic-rag-chatbot-fab>`), evitando il pattern di passare un @Input()
14754
+ * lungo la catena di componenti.
14755
+ *
14756
+ * Pattern d'uso (designer.component.ts):
14757
+ *
14758
+ * ngOnInit() {
14759
+ * this.chatbotHostRegistry.register('designer_inject', this.handleDesignerInject.bind(this));
14760
+ * }
14761
+ * ngOnDestroy() {
14762
+ * this.chatbotHostRegistry.unregister('designer_inject');
14763
+ * }
14764
+ *
14765
+ * Lato chatbot (rag-chatbot.component.ts), in onApplyActionToTurn():
14766
+ *
14767
+ * const action = turn.proposedAction;
14768
+ * const hostHandler = this.chatbotHostRegistry.get(action.kind);
14769
+ * if (hostHandler) {
14770
+ * // bypass backend - applica client-only
14771
+ * const result = await hostHandler(action);
14772
+ * ...
14773
+ * } else {
14774
+ * // backend apply standard
14775
+ * ...
14776
+ * }
14777
+ *
14778
+ * Registry per-kind: piu' kind possono avere handler distinti
14779
+ * registrati da componenti diversi. Quando l'host viene distrutto,
14780
+ * deve sempre fare unregister(kind) per evitare leak (es. handler
14781
+ * che cattura una vecchia istanza componente non piu' nel DOM).
14782
+ */
14783
+ /**
14784
+ * Signature del callback che fornisce uno snapshot testuale (compact tree)
14785
+ * dello state corrente dell'host, da iniettare nel `route_context` del LLM.
14786
+ *
14787
+ * Esempio dump del designer:
14788
+ * TABLE__123 (rows=2, cols=2)
14789
+ * TR__124
14790
+ * TD__125 (top-left)
14791
+ * TD__126 (top-right)
14792
+ * TR__127
14793
+ * TD__128 (bottom-left)
14794
+ * TD__129 (bottom-right)
14795
+ *
14796
+ * Ritornare `null` se lo state non e' rilevante per questo turn (es.
14797
+ * canvas vuoto), cosi' il chatbot non spreca token nel system prompt.
14798
+ */
14799
+ type ChatbotHostStateProvider = () => string | null;
14800
+ declare class ChatbotHostRegistryService {
14801
+ private readonly handlers;
14802
+ private readonly stateProviders;
14803
+ /**
14804
+ * Registra (o sostituisce) il handler per un dato `kind`. L'ultima
14805
+ * registrazione vince - utile per scenari edge in cui due viste
14806
+ * concorrenti gestiscono lo stesso kind (raro, ma documentato).
14807
+ */
14808
+ register(kind: string, handler: ChatbotHostActionHandler): void;
14809
+ /**
14810
+ * Rimuove il handler per un dato `kind`. No-op se non registrato.
14811
+ * Da chiamare in ngOnDestroy dell'host per evitare retain.
14812
+ */
14813
+ unregister(kind: string): void;
14814
+ /**
14815
+ * Restituisce il handler registrato per `kind`, o `null` se nessuno
14816
+ * lo gestisce client-side. Il chatbot usa questo per decidere se
14817
+ * bypassare il backend o no.
14818
+ */
14819
+ get(kind: string): ChatbotHostActionHandler | null;
14820
+ /**
14821
+ * Helper diagnostico: lista tutti i kind attualmente registrati.
14822
+ * Usato dai test e dal debug panel.
14823
+ */
14824
+ registeredKinds(): string[];
14825
+ /**
14826
+ * Registra (o sostituisce) un state provider per un dato `kind`.
14827
+ * Il provider verra' chiamato dal chatbot in `buildRouteContext()` per
14828
+ * arricchire il system prompt del LLM con lo state corrente dell'host
14829
+ * (es. designer.dashboardElements serializzati come tree compatto).
14830
+ *
14831
+ * Esempio (designer.component):
14832
+ * this.chatbotHostRegistry.registerStateProvider(
14833
+ * 'designer_inject',
14834
+ * () => this.buildCompactStateDump()
14835
+ * );
14836
+ */
14837
+ registerStateProvider(kind: string, provider: ChatbotHostStateProvider): void;
14838
+ /**
14839
+ * Rimuove il state provider. Da chiamare in ngOnDestroy.
14840
+ */
14841
+ unregisterStateProvider(kind: string): void;
14842
+ /**
14843
+ * Invoca il state provider registrato per `kind` e ritorna il dump.
14844
+ * Se non registrato, ritorna `null`. Errori nel provider sono
14845
+ * swallowed e logged (best-effort: il chatbot deve sempre funzionare
14846
+ * anche se l'host crasha durante il dump).
14847
+ */
14848
+ getStateDump(kind: string): string | null;
14849
+ /**
14850
+ * Helper diagnostico: lista tutti i kind con state provider attivo.
14851
+ */
14852
+ registeredStateKinds(): string[];
14853
+ /**
14854
+ * Invoca SYNC tutti gli state provider registrati ignorandone il risultato.
14855
+ *
14856
+ * Scopo: dare ai provider la possibilita' di triggerare i loro fetch lazy
14857
+ * (es. il designer prefetcha `getAvailableRoutes` solo quando lo state
14858
+ * provider viene invocato — altrimenti spreca chiamate al mount). Chiamato
14859
+ * dal chatbot in ngOnInit: la finestra "apertura chatbot" → "primo prompt
14860
+ * inviato" e' di almeno 1-2 secondi (l'utente deve digitare), tempo
14861
+ * sufficiente perche' la cache sia pronta al primo Ask. Senza warm-up,
14862
+ * il primo prompt vedrebbe state dump 'caricamento' e il LLM
14863
+ * potrebbe hallucinare nomi alternativi inventati.
14864
+ *
14865
+ * Errori dei provider vengono swallowed (lo stesso pattern di getStateDump).
14866
+ */
14867
+ warmUpAllStateProviders(): void;
14868
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotHostRegistryService, never>;
14869
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotHostRegistryService>;
14870
+ }
14871
+
14394
14872
  /**
14395
14873
  * Singolo turno della conversazione visualizzato nel chatbot.
14396
14874
  *
@@ -14412,6 +14890,51 @@ interface RagChatbotTurn {
14412
14890
  tokensOut?: number | null;
14413
14891
  /** GUID di correlazione (usato per match notifica completion). */
14414
14892
  correlationId?: string;
14893
+ /** Proposta d'azione emessa dall'LLM via tool-use, gia' parsata da JSON.
14894
+ * Null = nessuna proposta (risposta solo testo). */
14895
+ proposedAction?: RagProposedAction | null;
14896
+ /** Timestamp ISO dell'applicazione (audit). Null = mai applicata. */
14897
+ proposedActionAppliedAt?: string | null;
14898
+ /** Flag UI: true mentre il bottone "Applica" e' in flight (loading). */
14899
+ applyingAction?: boolean;
14900
+ /** Errore ultimo apply (UI feedback). */
14901
+ applyError?: string | null;
14902
+ /**
14903
+ * Lista di follow-up question parsate dal `followupQuestionsJson` del messaggio.
14904
+ * Renderizzata come chip cliccabili sotto la risposta assistant. Null/empty =
14905
+ * niente chip mostrate.
14906
+ */
14907
+ followupQuestions?: string[] | null;
14908
+ /**
14909
+ * Toggle textarea (default) <-> Monaco editor per il `callback_js` proposto.
14910
+ * Pattern identico a `<lib-code-area-editor>` (vedi
14911
+ * `field/code-area-editor/code-area-editor.component.ts`): di default mostra
14912
+ * una `<textarea>` leggera (niente chunk Monaco scaricato, niente flash nero),
14913
+ * con click su "Apri editor avanzato" si commuta e il `@defer (when ...)`
14914
+ * carica `<wuic-code-editor-lazy>` on-demand.
14915
+ */
14916
+ editorMode?: boolean;
14917
+ /**
14918
+ * True quando l'utente ha editato un campo della `proposedAction` in UI
14919
+ * (classe/stile o body del callback). Triggera la pre-flight
14920
+ * `updateProposedActionAsync` prima di `applyProposedActionAsync` cosi' il
14921
+ * backend rilegge dal DB il payload aggiornato (vedi commento sicurezza in
14922
+ * RagController.ApplyAction). Resettato a false dopo il PATCH riuscito.
14923
+ */
14924
+ proposedActionDirty?: boolean;
14925
+ }
14926
+ /**
14927
+ * Descrittore di un campo NON-body della proposta editabile dall'utente
14928
+ * sopra la textarea del callback (es. classe/stile per `table_style`, label
14929
+ * per `toolbar_action`). `fieldName` e' la chiave dentro `RagProposedAction`
14930
+ * su cui scrivere. `isInlineStyle` (solo per `css_class`) indica che il valore
14931
+ * UI mostra la parte dopo il prefisso `style:` — il setter ri-prepende.
14932
+ */
14933
+ interface RagProposedActionExtraField {
14934
+ label: string;
14935
+ fieldName: string;
14936
+ value: string;
14937
+ isInlineStyle?: boolean;
14415
14938
  }
14416
14939
  /**
14417
14940
  * Componente standalone che espone una chat sopra il RAG del codebase WUIC.
@@ -14436,9 +14959,11 @@ interface RagChatbotTurn {
14436
14959
  declare class WuicRagChatbotComponent implements OnInit, OnDestroy {
14437
14960
  private readonly ragService;
14438
14961
  private readonly cdr;
14962
+ private readonly chatbotHostRegistry;
14439
14963
  private readonly route?;
14440
14964
  private readonly router?;
14441
14965
  private readonly notificationRT?;
14966
+ private readonly metaSrv?;
14442
14967
  /** Titolo mostrato nell'header del chatbot. */
14443
14968
  title: string;
14444
14969
  /** Modalita' operativa: vedi nota nella classDoc. */
@@ -14451,12 +14976,52 @@ declare class WuicRagChatbotComponent implements OnInit, OnDestroy {
14451
14976
  maxHistory: number;
14452
14977
  /** Placeholder dell'input. */
14453
14978
  placeholder: string;
14454
- /** Modello Claude da usare in modalita' chat (default haiku 4.5). */
14979
+ /** Modello LLM in modalita' chat. Vuoto (default) = usa il model configurato lato
14980
+ * backend (`rag-llm-default-chat-model`), provider-appropriate. Non hardcodare un
14981
+ * model Anthropic: su provider openrouter/openai manderebbe un ID invalido (HTTP 400
14982
+ * -> retrieval-only). Valorizzare solo per forzare un model specifico. */
14455
14983
  model: string;
14456
14984
  /** Altezza fissa dell'area chat in CSS units (default `420px`). */
14457
14985
  chatHeight: string;
14458
14986
  /** Mostra il bottone "Svuota cronologia" nell'header. */
14459
14987
  showClearButton: boolean;
14988
+ /**
14989
+ * Persiste l'id della sessione corrente in `localStorage` e lo ripristina al
14990
+ * boot del componente (es. refresh della pagina) quando NON arriva un
14991
+ * `?sessionId` dalla route. La cronologia completa viene poi ricaricata dal DB
14992
+ * via `/api/Rag/History` (che ritorna TUTTI i messaggi della sessione, non un
14993
+ * sottoinsieme) -> il refresh non svuota piu' la chat. Default true.
14994
+ */
14995
+ persistSession: boolean;
14996
+ /**
14997
+ * Se `true` (default), prima di ogni `Ask` il componente costruisce un
14998
+ * **route context** sintetico (route corrente + tabella metadata + colonne)
14999
+ * dal `MetadataProviderService` e lo invia al rag_server come `routeContext`
15000
+ * nel payload. Il server lo inietta nel system prompt dell'LLM cosi' che le
15001
+ * risposte usino i NOMI REALI delle colonne della pagina corrente invece di
15002
+ * placeholder generici.
15003
+ *
15004
+ * Disabilitare a `false` per la route full-page `/rag-chatbot` (il chatbot
15005
+ * stesso non e' una "business route" — niente context utile da iniettare) o
15006
+ * per UI di privacy avanzata.
15007
+ */
15008
+ sendRouteContext: boolean;
15009
+ /** Chiave `localStorage` dell'ultima sessione (scoped per browser). */
15010
+ private static readonly LAST_SESSION_KEY;
15011
+ /**
15012
+ * Mostra il toggle "Vista Dev / Vista Cliente" nell'header (default OFF).
15013
+ * Da abilitare SOLO nelle pagine dev/demo: la chat spedita al cliente NON
15014
+ * deve esporlo. E' comunque leak-safe (il server applica strictest-of: il
15015
+ * toggle puo' solo aumentare la redazione, mai diminuirla).
15016
+ */
15017
+ allowProfileToggle: boolean;
15018
+ /**
15019
+ * Profilo di redazione corrente scelto dal toggle UI.
15020
+ * - 'internal' = Vista Dev (full source);
15021
+ * - 'release' = Vista Cliente (firme + niente skill, come on-prem).
15022
+ * Inviato al server solo se {@link allowProfileToggle} e' true.
15023
+ */
15024
+ profileOverride: RagProfile;
14460
15025
  /** Emette quando l'utente clicca su un source chip. */
14461
15026
  resultSelected: EventEmitter<RagSource>;
14462
15027
  /** Emette in caso di errore HTTP non recuperabile. */
@@ -14488,6 +15053,35 @@ declare class WuicRagChatbotComponent implements OnInit, OnDestroy {
14488
15053
  private processedNotificationIds;
14489
15054
  /** Sub a notificationRT.notifications$ + ActivatedRoute.queryParams. */
14490
15055
  private subs;
15056
+ /**
15057
+ * Context window usage del modello corrente (ultima stima dal backend, 0-100%).
15058
+ * Aggiornato a ogni completion. Driver del cerchio colorato in header:
15059
+ * verde <60% / giallo 60-80% / arancione 80-90% / rosso >90%.
15060
+ */
15061
+ contextUsagePercent: number;
15062
+ /** Token usati (dall'ultima call) / context window max. Mostrati in tooltip. */
15063
+ contextUsedTokens: number | null;
15064
+ contextWindowMax: number | null;
15065
+ /** True quando il dialog "context-overflow" e' aperto: l'ultima call ha
15066
+ * fallito perche' la history sfora il context. UX: 2 bottoni (Compatta / Nuova). */
15067
+ contextOverflowDialogOpen: boolean;
15068
+ /** True mentre il /compact e' in-flight (loading nel bottone). */
15069
+ compactingSession: boolean;
15070
+ /**
15071
+ * True per tutto il flow `onClearHistory`: apertura prompt di conferma
15072
+ * (PrimeNG Dialog lazy-load, ~300-800ms al primo click) + DELETE backend +
15073
+ * reset stato locale. Driver dello spinner sul bottone cestino in header.
15074
+ * Re-entry guard: blocca click multipli mentre il flow e' in corso.
15075
+ */
15076
+ clearingHistory: boolean;
15077
+ /** True quando il dialog "Sessioni" e' aperto. Lazy-load lista al toggle. */
15078
+ sessionsDialogOpen: boolean;
15079
+ sessionsList: RagChatSessionDto[];
15080
+ sessionsLoading: boolean;
15081
+ /** Map sessionId -> bool: true se quella riga e' in modalita' rinomina. */
15082
+ sessionRenameEditing: Record<number, boolean>;
15083
+ /** Map sessionId -> string: valore temporaneo del titolo durante l'edit inline. */
15084
+ sessionRenameDraft: Record<number, string>;
14491
15085
  /**
14492
15086
  * Source selezionato per il dialog preview. Null = dialog chiuso.
14493
15087
  * Il dialog mostra SOLO lo snippet embedded in RagSource (max 500 char dal
@@ -14497,7 +15091,7 @@ declare class WuicRagChatbotComponent implements OnInit, OnDestroy {
14497
15091
  selectedSource: RagSource | null;
14498
15092
  inputTextarea?: ElementRef<HTMLTextAreaElement>;
14499
15093
  scrollContainer?: ElementRef<HTMLElement>;
14500
- constructor(ragService: WuicRagService, cdr: ChangeDetectorRef, route?: ActivatedRoute, router?: Router, notificationRT?: NotificationRealtimeService);
15094
+ constructor(ragService: WuicRagService, cdr: ChangeDetectorRef, chatbotHostRegistry: ChatbotHostRegistryService, route?: ActivatedRoute, router?: Router, notificationRT?: NotificationRealtimeService, metaSrv?: MetadataProviderService);
14501
15095
  ngOnInit(): void;
14502
15096
  ngOnDestroy(): void;
14503
15097
  get effectiveMode(): 'rag-llm' | 'retrieval-only';
@@ -14505,6 +15099,14 @@ declare class WuicRagChatbotComponent implements OnInit, OnDestroy {
14505
15099
  get modeBadgeSeverity(): 'success' | 'info' | 'warn' | 'danger';
14506
15100
  /** Disabilita il send button SOLO durante la chiamata Ask (~200ms), NON durante il pending. */
14507
15101
  get sendDisabled(): boolean;
15102
+ /** Label del toggle profilo. */
15103
+ get profileToggleLabel(): string;
15104
+ /**
15105
+ * Flippa il profilo di redazione (Dev <-> Cliente). Le risposte gia' in
15106
+ * cronologia restano com'erano (il profilo e' per-richiesta); i prossimi
15107
+ * invii usano il nuovo profilo.
15108
+ */
15109
+ toggleProfile(): void;
14508
15110
  /**
14509
15111
  * Invia il prompt corrente via flow async:
14510
15112
  * 1. Append turno user (placeholder, sara' ricevuto messageId nell'ack);
@@ -14517,6 +15119,13 @@ declare class WuicRagChatbotComponent implements OnInit, OnDestroy {
14517
15119
  /**
14518
15120
  * Svuota la cronologia chat (soft-delete della sessione corrente sul DB) +
14519
15121
  * reset stato locale.
15122
+ *
15123
+ * Il flag `clearingHistory` resta `true` per tutto il flow (dall'apertura
15124
+ * del dialog di conferma fino al completamento DELETE+reset). Driver dello
15125
+ * spinner sul bottone cestino in header — necessario perche' il PRIMO click
15126
+ * subisce ~300-800ms di lazy-load del bundle PrimeNG Dialog
15127
+ * (`promptDialog` apre un `p-dialog` dinamico, non gia' istanziato). Senza
15128
+ * feedback l'utente cliccava 2-3 volte pensando che non rispondesse.
14520
15129
  */
14521
15130
  onClearHistory(): Promise<void>;
14522
15131
  /**
@@ -14630,12 +15239,219 @@ declare class WuicRagChatbotComponent implements OnInit, OnDestroy {
14630
15239
  private dtoToTurn;
14631
15240
  private applyMessageToTurn;
14632
15241
  private scrollToMessage;
15242
+ /**
15243
+ * Persiste (o cancella se id null) l'ultima sessione in localStorage.
15244
+ * Best-effort: guard SSR + try/catch (private-mode / quota / storage disabled).
15245
+ */
15246
+ private saveLastSession;
15247
+ /** Legge l'ultima sessione salvata (>0) o null. */
15248
+ private readLastSession;
15249
+ /** Parse JSON del field `proposed_action_json` -> oggetto tipato (o null). */
15250
+ private parseProposedAction;
15251
+ /** Parse JSON del field `followup_questions_json` -> array di stringhe (o null). */
15252
+ private parseFollowupQuestions;
15253
+ /**
15254
+ * Click su un chip follow-up: popola l'input box con la domanda (NON invia
15255
+ * automaticamente; l'utente puo' editare prima di premere invio). Coerente
15256
+ * con la scelta UX di non lanciare query "per sbaglio".
15257
+ */
15258
+ applyFollowup(question: string): void;
15259
+ /** Aggiorna lo stato del cerchio cue dato (usedTokens, windowMax). */
15260
+ private updateContextCue;
15261
+ /** Colore del cerchio basato sul `contextUsagePercent`. */
15262
+ get contextCueColor(): string;
15263
+ get contextCueTooltip(): string;
15264
+ /**
15265
+ * Click sul cerchio context cue: conferma + lancia /compact. Disponibile sempre
15266
+ * (anche <60%): l'utente puo' compattare on-demand.
15267
+ */
15268
+ onContextCueClick(): Promise<void>;
15269
+ /**
15270
+ * Chiama l'endpoint /api/Rag/Compact. Aggiorna lo stato dopo successo.
15271
+ * Riusato da: contextCue click, slash-command /compact, dialog overflow "Compatta ora".
15272
+ */
15273
+ doCompactSession(): Promise<void>;
15274
+ /**
15275
+ * Nuova sessione: chiude la corrente (clear localStorage), resetta history, ricomincia.
15276
+ * Chiamato dal bottone "Nuova sessione" del dialog overflow.
15277
+ */
15278
+ startNewSession(): void;
15279
+ openSessionsDialog(): Promise<void>;
15280
+ closeSessionsDialog(): void;
15281
+ /** Switch alla session selezionata (carica history). */
15282
+ selectSession(s: RagChatSessionDto): Promise<void>;
15283
+ /** Apre l'edit inline del titolo. */
15284
+ startRenameSession(s: RagChatSessionDto, event?: Event): void;
15285
+ confirmRenameSession(s: RagChatSessionDto, event?: Event): Promise<void>;
15286
+ cancelRenameSession(s: RagChatSessionDto): void;
15287
+ /**
15288
+ * Cancella una sessione dalla cronologia (chiamato dall'icona cestino
15289
+ * sulla riga della lista sessioni). Confirm via WtoolboxService.promptDialog
15290
+ * (regola 12 AGENTS: mai window.confirm). Backend soft-delete via
15291
+ * POST /api/Rag/DeleteSession (gia' esistente).
15292
+ *
15293
+ * Se la sessione cancellata e' quella CORRENTE: clear della view (history
15294
+ * + currentSessionId reset) e remove da localStorage. Se non corrente:
15295
+ * solo splice dalla lista locale senza toccare la chat aperta.
15296
+ *
15297
+ * Best-effort: errori backend swallowed (la lista si refresha al prossimo
15298
+ * open del dialog comunque, e l'utente puo' riprovare).
15299
+ */
15300
+ onDeleteSessionFromList(s: RagChatSessionDto, event?: Event): Promise<void>;
15301
+ /** Truncate del primo prompt a 100 char per anteprima list (full su tooltip). */
15302
+ sessionPreview(s: RagChatSessionDto): string;
15303
+ /** Formato data sessione (locale). */
15304
+ sessionDate(s: RagChatSessionDto): string;
15305
+ /** Label umana per il bottone/header in base al `kind`. */
15306
+ proposedActionTitle(a: RagProposedAction | null | undefined): string;
15307
+ /**
15308
+ * Estrae il body del code/template della proposta indipendentemente dal kind:
15309
+ * - toolbar_action / row_action / default_value / custom_validation /
15310
+ * selection_changed / lifecycle / form_title → `callback_js` / `formula_js`
15311
+ * - table_style / column_style → `condition_js`
15312
+ * - display_formula → `template_html` (Angular markup)
15313
+ * o `formula_js` (legacy backward-compat)
15314
+ * - sql_metadata_field → `sql_snippet` (SQL fragment)
15315
+ * Ritorna stringa vuota se nessun campo body e' presente.
15316
+ */
15317
+ proposedActionJsBody(a: RagProposedAction | null | undefined): string;
15318
+ /**
15319
+ * Campi NON-body della proposta che e' utile mostrare all'utente accanto
15320
+ * al codice (es. per `table_style` la classe CSS o l'inline-style che verra'
15321
+ * applicato alla `<tr>` quando il callback ritorna true; per `toolbar_action`
15322
+ * la label del bottone; per `sql_metadata_field` il field target). Per ogni
15323
+ * kind ritorna 0..N coppie `{label, value}`. Il template li renderizza in
15324
+ * lettura sopra la textarea del body. Mantenere allineato alla definizione
15325
+ * tool in `rag_tools.json`: quando si aggiunge un campo importante a un kind
15326
+ * (es. `inline_style` su `propose_table_style`), aggiungerlo anche qui per
15327
+ * non far perdere visibilita' all'utente sulla decisione del LLM.
15328
+ */
15329
+ proposedActionExtraFields(a: RagProposedAction | null | undefined): Array<RagProposedActionExtraField>;
15330
+ /**
15331
+ * Nome del campo nella `RagProposedAction` che porta il body editabile della
15332
+ * textarea (callback / template / sql snippet). Speculare a
15333
+ * `proposedActionJsBody` ma ritorna l'identificatore del field, cosi' il
15334
+ * `(ngModelChange)` puo' scrivere su `a[name]`. Default `callback_js` per i
15335
+ * kind che non hanno un body editabile (no-op all'edit).
15336
+ */
15337
+ proposedActionJsBodyFieldName(a: RagProposedAction | null | undefined): string;
15338
+ /**
15339
+ * Setter chiamato da `(ngModelChange)` su un campo extra (es. classe/stile).
15340
+ * Per `css_class` con `isInlineStyle=true` ri-prepende il prefisso `style:`
15341
+ * cosi' la convenzione persistita resta omogenea (vedi
15342
+ * `dynamic-template.component.ts:getTableInlineStyle`). Segna il turno come
15343
+ * `proposedActionDirty=true` cosi' `onApplyAction` chiama il PATCH backend
15344
+ * prima dell'Apply.
15345
+ */
15346
+ onProposedExtraFieldEdit(turn: RagChatbotTurn, extra: RagProposedActionExtraField, newValue: string): void;
15347
+ /**
15348
+ * Setter per la textarea del body (callback_js / condition_js / template_html
15349
+ * / formula_js / sql_snippet). Aggiorna il field corretto in base al kind.
15350
+ */
15351
+ onProposedBodyEdit(turn: RagChatbotTurn, newValue: string): void;
15352
+ /**
15353
+ * Stessa `codeContext` che il metadata-editor usa per editare il callback
15354
+ * sullo stesso campo metadata. Permette al Monaco TS provider di applicare
15355
+ * autocomplete + type-check come se l'utente stesse editando in metadata-editor.
15356
+ * Centralizzato qui per kind: future aggiunte = entry nella map.
15357
+ */
15358
+ proposedActionCodeContext(a: RagProposedAction | null | undefined): string;
15359
+ /**
15360
+ * Cache field+record sintetici per `<wuic-code-editor>` indicizzata per messageId.
15361
+ * MOTIVATION: il code-editor accetta `field: MetadatiColonna` e
15362
+ * `record: { [k]: BehaviorSubject<any> }`; ricostruirli ad ogni ciclo di CD
15363
+ * causerebbe re-init pesanti del Monaco (riload types, ecc). Cache stabile per
15364
+ * messageId -> stesse referenze -> niente re-init.
15365
+ */
15366
+ private proposedActionEditorCache;
15367
+ /**
15368
+ * Costruisce (o riusa cached) il `MetadatiColonna` sintetico da passare al
15369
+ * `<wuic-code-editor>` per il box proposta. Inietta il `codeContext` corretto
15370
+ * per il `kind` cosi' il TSProvider Monaco applica autocomplete come nel
15371
+ * metadata-editor stesso. L'editor e' EDITABILE (readOnly:false): le modifiche
15372
+ * vengono propagate a `turn.proposedAction[bodyFieldName]` tramite subscription
15373
+ * al BehaviorSubject del record, e segnano il turno come dirty cosi'
15374
+ * `onApplyAction` chiama il PATCH backend prima dell'Apply.
15375
+ */
15376
+ getProposedActionField(turn: RagChatbotTurn): MetadatiColonna;
15377
+ /** Compagno di `getProposedActionField`: ritorna lo stesso `record` cached. */
15378
+ getProposedActionRecord(turn: RagChatbotTurn): {
15379
+ [key: string]: BehaviorSubject<any>;
15380
+ };
15381
+ /**
15382
+ * Toggle textarea (default) <-> Monaco editor avanzato per il callback proposto.
15383
+ * Pattern `<lib-code-area-editor>`: textarea istantanea, Monaco on-demand via
15384
+ * `@defer (when turn.editorMode)`. Entrando in Monaco ri-sincronizza il
15385
+ * BehaviorSubject del record cached col valore corrente di `proposedAction`
15386
+ * (potrebbe essere stato editato dalla textarea nel frattempo, vedi
15387
+ * `onProposedBodyEdit`).
15388
+ */
15389
+ toggleEditorMode(turn: RagChatbotTurn): void;
15390
+ /** True se il turn ha una proposta non ancora applicata (mostra "Applica"). */
15391
+ canApplyAction(turn: RagChatbotTurn): boolean;
15392
+ /**
15393
+ * Bottone "Applica": chiama POST /api/Rag/ApplyAction con conferma. Il server
15394
+ * re-legge la proposta dal DB (anti-tampering del callback_js), checka admin,
15395
+ * INSERT su metadata, InvalidateMetadataCachesAndSetVersion. La proposta viene
15396
+ * marcata come applicata in DB.
15397
+ */
15398
+ onApplyAction(turn: RagChatbotTurn): Promise<void>;
14633
15399
  private trimHistory;
15400
+ /**
15401
+ * Costruisce un riepilogo testuale della pagina/route corrente che viene
15402
+ * iniettato nel system prompt dell'LLM. Permette di generare snippet che
15403
+ * usano i nomi REALI delle colonne (es. `record.CityName.value`) invece di
15404
+ * placeholder generici.
15405
+ *
15406
+ * Formato (compatto, leggibile dall'LLM):
15407
+ * ```
15408
+ * Route corrente: cities
15409
+ * Tabella: Cities (md_id=42, mdtablename=Cities)
15410
+ * Colonne:
15411
+ * - CityName: type=text, required=yes (real column: CityName)
15412
+ * - StateProvince: type=lookupByID -> StateProvinces
15413
+ * - Location: type=text
15414
+ * - LatestRecordedPopulation: type=number
15415
+ * - btn_send: type=button (row action)
15416
+ * ```
15417
+ *
15418
+ * Ritorna `null` se: router assente, route non resolvibile, route NON e'
15419
+ * una business route (framework-docs/rag-chatbot/auth), o metadata
15420
+ * non disponibile in cache (l'utente probabilmente non e' su una list/edit
15421
+ * della route).
15422
+ */
15423
+ private buildRouteContext;
15424
+ /**
15425
+ * Contesto MINIMALE della pagina: SOLO la route/pagina corrente (es. `cities/list`,
15426
+ * `cities/edit`, `designer`). I dettagli di metadata (elenco colonne reali, identita'
15427
+ * SQL schema/tabella, alias di join dei lookup) NON sono inlineati: il LLM li recupera
15428
+ * ON-DEMAND via il tool `request_metadata_detail` (detail='columns'|'lookup_columns'),
15429
+ * risolto lato backend da `RagController.ResolveMetadataDetail`.
15430
+ *
15431
+ * RAZIONALE: inlinare colonne + SQL identity gonfiava OGNI richiesta a prescindere dal
15432
+ * prompt (context window saturato, token sprecati). Col retrieval agentico il model
15433
+ * recupera SOLO cio' che il prompt richiede, e il meccanismo scala a N dimensioni di
15434
+ * metadata (physical_columns, related_routes, enum_values, ...) senza toccare questo
15435
+ * builder. Vale per qualunque pagina, incluse quelle framework (designer, ...): il
15436
+ * model puo' comunque targetizzare una route business via retrieval.
15437
+ */
15438
+ private buildMinimalPageContext;
15439
+ /**
15440
+ * Concatena lo state dump fornito dai componenti host che hanno registrato
15441
+ * un state provider per un proposed_action kind. Tipicamente designer.component
15442
+ * registra `designer_inject` con un tree dei dashboardElements (uniqueName +
15443
+ * inputs significativi), cosi' il LLM puo' identificare componenti via
15444
+ * uniqueName quando l'utente chiede modifiche tipo "cambia background
15445
+ * del riquadro in alto a destra".
15446
+ *
15447
+ * Ritorna `null` se nessun host ha registrato dump per il turn corrente.
15448
+ */
15449
+ private buildHostStateContext;
14634
15450
  private scheduleScrollToBottom;
14635
15451
  private focusInput;
14636
15452
  private extractErrorMessage;
14637
- static ɵfac: i0.ɵɵFactoryDeclaration<WuicRagChatbotComponent, [null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
14638
- static ɵcmp: i0.ɵɵComponentDeclaration<WuicRagChatbotComponent, "wuic-rag-chatbot", never, { "title": { "alias": "title"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "topK": { "alias": "topK"; "required": false; }; "showSources": { "alias": "showSources"; "required": false; }; "maxHistory": { "alias": "maxHistory"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "model": { "alias": "model"; "required": false; }; "chatHeight": { "alias": "chatHeight"; "required": false; }; "showClearButton": { "alias": "showClearButton"; "required": false; }; }, { "resultSelected": "resultSelected"; "errorOccurred": "errorOccurred"; "turnAdded": "turnAdded"; }, never, never, true, never>;
15453
+ static ɵfac: i0.ɵɵFactoryDeclaration<WuicRagChatbotComponent, [null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
15454
+ static ɵcmp: i0.ɵɵComponentDeclaration<WuicRagChatbotComponent, "wuic-rag-chatbot", never, { "title": { "alias": "title"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "topK": { "alias": "topK"; "required": false; }; "showSources": { "alias": "showSources"; "required": false; }; "maxHistory": { "alias": "maxHistory"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "model": { "alias": "model"; "required": false; }; "chatHeight": { "alias": "chatHeight"; "required": false; }; "showClearButton": { "alias": "showClearButton"; "required": false; }; "persistSession": { "alias": "persistSession"; "required": false; }; "sendRouteContext": { "alias": "sendRouteContext"; "required": false; }; "allowProfileToggle": { "alias": "allowProfileToggle"; "required": false; }; }, { "resultSelected": "resultSelected"; "errorOccurred": "errorOccurred"; "turnAdded": "turnAdded"; }, never, never, true, never>;
14639
15455
  }
14640
15456
 
14641
15457
  /**
@@ -14667,6 +15483,7 @@ declare class WuicRagChatbotFabComponent implements OnInit, OnDestroy {
14667
15483
  private readonly licenseService;
14668
15484
  private readonly notificationRT;
14669
15485
  private readonly cdr;
15486
+ private readonly router;
14670
15487
  /** Tooltip dell'icona FAB. */
14671
15488
  fabTooltip: string;
14672
15489
  /** Titolo del dialog (passato anche al chatbot interno). */
@@ -14702,9 +15519,18 @@ declare class WuicRagChatbotFabComponent implements OnInit, OnDestroy {
14702
15519
  licenseAllowed: boolean;
14703
15520
  /** Counter unread per il badge sul FAB. */
14704
15521
  unreadRagCount: number;
15522
+ /**
15523
+ * True quando la route corrente e' `/rag-chatbot` (o un suo sub-path).
15524
+ * Nascondiamo il FAB in quel caso perche' renderebbe un launcher duplicato
15525
+ * sopra il chatbot gia' aperto a tutta pagina. Aggiornato reattivamente
15526
+ * ai `NavigationEnd` del Router, e inizializzato dal `router.url` corrente
15527
+ * cosi' il primo render (es. F5 mentre sei gia' sulla route) e' coerente.
15528
+ */
15529
+ private onRagChatbotRoute;
14705
15530
  private subs;
14706
- constructor(licenseService: LicenseFeatureService, notificationRT: NotificationRealtimeService, cdr: ChangeDetectorRef);
15531
+ constructor(licenseService: LicenseFeatureService, notificationRT: NotificationRealtimeService, cdr: ChangeDetectorRef, router: Router);
14707
15532
  ngOnInit(): void;
15533
+ private updateOnRagChatbotRoute;
14708
15534
  ngOnDestroy(): void;
14709
15535
  get visible(): boolean;
14710
15536
  /**
@@ -14940,6 +15766,19 @@ declare const AUTH_REDIRECT_REASON_KEY = "wuic_auth_redirect_reason";
14940
15766
  */
14941
15767
  declare const authExpiredInterceptor: HttpInterceptorFn;
14942
15768
 
15769
+ /**
15770
+ * Quando una richiesta HTTP imposta questo token nel suo `HttpContext`,
15771
+ * l'interceptor NON inoltra l'errore al `GlobalHandler` (niente dialog/toast
15772
+ * globale): l'errore viene comunque normalizzato e rilanciato, ma la sua
15773
+ * presentazione e' lasciata interamente al chiamante (es. il first-run wizard
15774
+ * che mostra l'errore SOLO inline nel form). Default: false (comportamento
15775
+ * standard col dialog globale).
15776
+ *
15777
+ * Uso:
15778
+ * import { HttpContext } from '@angular/common/http';
15779
+ * this.http.post(url, body, { context: new HttpContext().set(WUIC_SUPPRESS_GLOBAL_ERROR, true) });
15780
+ */
15781
+ declare const WUIC_SUPPRESS_GLOBAL_ERROR: HttpContextToken<boolean>;
14943
15782
  /** Functional interceptor — preferred form for Angular 15+ withInterceptors. */
14944
15783
  declare const wuicErrorInterceptor: HttpInterceptorFn;
14945
15784
  /** Class interceptor — kept for legacy NgModule consumers. */
@@ -15035,5 +15874,5 @@ declare const THEME_OPTIONS: ThemeOption[];
15035
15874
  declare function getThemeOptions(): ThemeOption[];
15036
15875
  declare function getThemePrimaryHex(value: string): string;
15037
15876
 
15038
- export { AUTH_REDIRECT_REASON_KEY, AppSettingsEditorComponent, AuthSessionService, BooleanEditorComponent, BoundedRepeaterComponent, ButtonEditorComponent, CallbackPipe, CallbackPipe2, CarouselListComponent, CodeAreaEditorComponent, ColorEditorComponent, CrashReporterService, CustomAttributesService, CustomException, DataActionButtonComponent, DataProviderOdataService, DataRepeaterComponent, DataSourceComponent, DateEditorComponent, DesignerRouteComponent, DictionaryEditorComponent, DynamicCompilerService, DynamicRowTemplateComponent, FieldEditorComponent, FilterBarComponent, FilterInfo, FormatGridViewValuePipe, GetSrcUploadPreviewPipe, GlobalHandler, HtmlEditorComponent, ImageWrapperComponent, ImportExportButtonComponent, IsSelectedRowPipe, KanbanListComponent, KanbanOptions, KanbanStatusColumnItem, LazyChartListComponent, LazyCodeEditorComponent, LazyDataActionButtonComponent, LazyDataSourceComponent, LazyFieldEditorComponent, LazyFirstRunWizardComponent, LazyImageWrapperComponent, LazyKanbanListComponent, LazyMetaMenuComponent, LazyPivotBuilderComponent, LazyReportDesignerComponent, LazyReportViewerComponent, LazySchedulerListComponent, LazySpreadsheetListSfComponent, LicenseFeatureService, ListGridComponent, LookupEditorComponent, MapListComponent, MetaInfo, MetaMenuComponent, MetadataEditorService, MetadataProviderService, MetadatiColonna, MetadatiTabella, NotificationBellComponent, NotificationRealtimeService, NumberEditorComponent, PRIMARY_PALETTES, PagerComponent, ParametricDialogComponent, PropertyArrayEditorComponent, PropertyObjectEditorComponent, THEME_OPTIONS, TextAreaEditorComponent, TextEditorComponent, TranslationManagerService, TreeListComponent, TreeViewSelectorComponent, UploadDialogComponent, UploadEditorComponent, UserInfoService, ValidationRule, ValueChangedPayload, VisibleFieldListPipe, WidgetDefinition, WorkflowDesignerRouteComponent, WorkflowRunnerComponent, WorkflowRuntimeMetadataService, WtoolboxService, WuicAziendaSwitcherComponent, WuicErrorDialogComponent, WuicErrorInterceptor, WuicFeatureDirective, WuicFrozenColumnDirective, WuicRagChatbotComponent, WuicRagChatbotFabComponent, WuicRagService, WuicRowTogglerDirective, _PRIMENG_TABLE_DIRECTIVES_NAMES, authExpiredInterceptor, boundedRepeaterPendingChangesGuard, featureRouteCanActivateGuard, featureRouteCanMatchGuard, getThemeOptions, getThemePrimaryHex, inferTemplateFieldFromBaseClass, loadBooleanEditorComponent, loadButtonEditorComponent, loadCodeAreaEditorComponent, loadColorEditorComponent, loadDateEditorComponent, loadDictionaryEditorComponent, loadHtmlEditorComponent, loadLookupEditorComponent, loadNumberEditorComponent, loadPropertyArrayEditorComponent, loadPropertyObjectEditorComponent, loadTextAreaEditorComponent, loadTextEditorComponent, loadTreeViewSelectorComponent, loadUploadEditorComponent, menuRouteAccessCanActivateGuard, menuRouteAccessCanMatchGuard, routes, wuicErrorInterceptor };
15039
- export type { AuthSessionState, Breadcrumb, CompileDynamicComponentOptions, CrashReportPayload, CrashReportingConfig, CustomAttributeDefinition, CustomAttributeResolved, CustomLookupOption, CustomValue, CvUpsertItem, DataSourceAfterSyncEvent, DataSourceBeforeSyncEvent, DataSourceSyncOperation, ErrorDelegate, ErrorDelegateContext, IDataBoundHostComponent, IFieldEditor, KanbanStatusColumn, LicenseStatusResponse, ListGridAfterRenderEvent, ListGridAfterRowRenderEvent, ListGridBeforeRowRenderEvent, MultiDatasourceMeta, NotificationItem, NotifyOptions, RagAskAcceptedResponse, RagAskRequest, RagChatHistorySnapshot, RagChatMessageDto, RagChatMessageStatus, RagChatRequest, RagChatResponse, RagChatSessionDto, RagChatTurn, RagChatbotTurn, RagHealthResponse, RagQueryRequest, RagQueryResponse, RagSource, RealtimeProgressEvent, ThemeOption, ThemePresetName, ThemePrimaryName, WorkflowRuntimeLinkedActionRouteMetadataEntry, WorkflowRuntimePreviousRouteNodeEntry, WorkflowRuntimeRouteMetadataEntry, WorkflowRuntimeRouteNodePayloadEntry };
15877
+ export { AUTH_REDIRECT_REASON_KEY, AppSettingsEditorComponent, AuthSessionService, BooleanEditorComponent, BoundedRepeaterComponent, ButtonEditorComponent, CallbackPipe, CallbackPipe2, CarouselListComponent, CodeAreaEditorComponent, ColorEditorComponent, CrashReporterService, CustomAttributesService, CustomException, DataActionButtonComponent, DataProviderOdataService, DataRepeaterComponent, DataSourceComponent, DateEditorComponent, DesignerRouteComponent, DictionaryEditorComponent, DynamicCompilerService, DynamicRowTemplateComponent, FieldEditorComponent, FilterBarComponent, FilterInfo, FormatGridViewValuePipe, GetSrcUploadPreviewPipe, GlobalHandler, HtmlEditorComponent, ImageWrapperComponent, ImportExportButtonComponent, IsSelectedRowPipe, KanbanListComponent, KanbanOptions, KanbanStatusColumnItem, LazyChartListComponent, LazyCodeEditorComponent, LazyDataActionButtonComponent, LazyDataSourceComponent, LazyFieldEditorComponent, LazyFirstRunWizardComponent, LazyImageWrapperComponent, LazyKanbanListComponent, LazyMetaMenuComponent, LazyPivotBuilderComponent, LazyReportDesignerComponent, LazyReportViewerComponent, LazySchedulerListComponent, LazySpreadsheetListSfComponent, LicenseFeatureService, ListGridComponent, LookupEditorComponent, MapListComponent, MetaInfo, MetaMenuComponent, MetadataEditorService, MetadataProviderService, MetadatiColonna, MetadatiTabella, NotificationBellComponent, NotificationRealtimeService, NumberEditorComponent, PRIMARY_PALETTES, PagerComponent, ParametricDialogComponent, PropertyArrayEditorComponent, PropertyObjectEditorComponent, THEME_OPTIONS, TextAreaEditorComponent, TextEditorComponent, TranslationManagerService, TreeListComponent, TreeViewSelectorComponent, UploadDialogComponent, UploadEditorComponent, UserInfoService, ValidationRule, ValueChangedPayload, VisibleFieldListPipe, WUIC_SUPPRESS_GLOBAL_ERROR, WidgetDefinition, WorkflowDesignerRouteComponent, WorkflowRunnerComponent, WorkflowRuntimeMetadataService, WtoolboxService, WuicAziendaSwitcherComponent, WuicErrorDialogComponent, WuicErrorInterceptor, WuicFeatureDirective, WuicFrozenColumnDirective, WuicRagChatbotComponent, WuicRagChatbotFabComponent, WuicRagService, WuicRowTogglerDirective, _PRIMENG_TABLE_DIRECTIVES_NAMES, authExpiredInterceptor, boundedRepeaterPendingChangesGuard, featureRouteCanActivateGuard, featureRouteCanMatchGuard, getThemeOptions, getThemePrimaryHex, inferTemplateFieldFromBaseClass, loadBooleanEditorComponent, loadButtonEditorComponent, loadCodeAreaEditorComponent, loadColorEditorComponent, loadDateEditorComponent, loadDictionaryEditorComponent, loadHtmlEditorComponent, loadLookupEditorComponent, loadNumberEditorComponent, loadPropertyArrayEditorComponent, loadPropertyObjectEditorComponent, loadTextAreaEditorComponent, loadTextEditorComponent, loadTreeViewSelectorComponent, loadUploadEditorComponent, menuRouteAccessCanActivateGuard, menuRouteAccessCanMatchGuard, routes, wuicErrorInterceptor };
15878
+ export type { AuthSessionState, Breadcrumb, CompileDynamicComponentOptions, CrashReportPayload, CrashReportingConfig, CustomAttributeDefinition, CustomAttributeResolved, CustomLookupOption, CustomValue, CvUpsertItem, DataSourceAfterSyncEvent, DataSourceBeforeSyncEvent, DataSourceSyncOperation, ErrorDelegate, ErrorDelegateContext, IDataBoundHostComponent, IFieldEditor, KanbanStatusColumn, LicenseStatusResponse, ListGridAfterRenderEvent, ListGridAfterRowRenderEvent, ListGridBeforeRowRenderEvent, MultiDatasourceMeta, NotificationItem, NotifyOptions, RagApplyActionRequest, RagApplyActionResponse, RagAskAcceptedResponse, RagAskRequest, RagChatHistorySnapshot, RagChatMessageDto, RagChatMessageStatus, RagChatRequest, RagChatResponse, RagChatSessionDto, RagChatTurn, RagChatbotTurn, RagCompactRequest, RagCompactResponse, RagHealthResponse, RagProfile, RagProposedAction, RagProposedActionExtraField, RagProposedActionKind, RagQueryRequest, RagQueryResponse, RagRenameSessionRequest, RagRenameSessionResponse, RagSource, RagUpdateProposedActionRequest, RagUpdateProposedActionResponse, RealtimeProgressEvent, ThemeOption, ThemePresetName, ThemePrimaryName, WorkflowRuntimeLinkedActionRouteMetadataEntry, WorkflowRuntimePreviousRouteNodeEntry, WorkflowRuntimeRouteMetadataEntry, WorkflowRuntimeRouteNodePayloadEntry };