@praxisui/page-builder 8.0.0-beta.103 → 8.0.0-beta.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/fesm2022/praxisui-page-builder.mjs +427 -149
- package/package.json +4 -4
- package/types/praxisui-page-builder.d.ts +17 -3
|
@@ -7,7 +7,7 @@ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
|
7
7
|
import * as i2$1 from '@angular/material/icon';
|
|
8
8
|
import { MatIconModule } from '@angular/material/icon';
|
|
9
9
|
import * as i2$2 from '@praxisui/core';
|
|
10
|
-
import { PraxisIconDirective, BUILTIN_SHELL_PRESETS, providePraxisI18n, PraxisI18nService, GLOBAL_ACTION_CATALOG, getGlobalActionCatalog, PRAXIS_GLOBAL_ACTION_CATALOG, SurfaceOpenActionEditorComponent, SETTINGS_PANEL_DATA as SETTINGS_PANEL_DATA$1, BUILTIN_PAGE_LAYOUT_PRESETS, BUILTIN_PAGE_THEME_PRESETS, deepMerge, generateId, ComponentMetadataRegistry, domainKnowledgeTimelineToRichContentDocument, DomainRuleService, DomainKnowledgeService, SETTINGS_PANEL_BRIDGE, DynamicWidgetPageComponent, DYNAMIC_PAGE_SHELL_EDITOR } from '@praxisui/core';
|
|
10
|
+
import { PraxisIconDirective, BUILTIN_SHELL_PRESETS, providePraxisI18n, PraxisI18nService, GLOBAL_ACTION_CATALOG, getGlobalActionCatalog, PRAXIS_GLOBAL_ACTION_CATALOG, SurfaceOpenActionEditorComponent, SETTINGS_PANEL_DATA as SETTINGS_PANEL_DATA$1, BUILTIN_PAGE_LAYOUT_PRESETS, BUILTIN_PAGE_THEME_PRESETS, deepMerge, generateId, ComponentMetadataRegistry, PraxisRuntimeComponentObservationRegistryService, domainKnowledgeTimelineToRichContentDocument, DomainRuleService, DomainKnowledgeService, SETTINGS_PANEL_BRIDGE, DynamicWidgetPageComponent, DYNAMIC_PAGE_SHELL_EDITOR } from '@praxisui/core';
|
|
11
11
|
export { WidgetShellComponent } from '@praxisui/core';
|
|
12
12
|
import * as i3 from '@angular/material/tooltip';
|
|
13
13
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
@@ -25,7 +25,7 @@ import * as i6 from '@angular/material/divider';
|
|
|
25
25
|
import { MatDividerModule } from '@angular/material/divider';
|
|
26
26
|
import * as i6$1 from '@angular/material/select';
|
|
27
27
|
import { MatSelectModule } from '@angular/material/select';
|
|
28
|
-
import { BehaviorSubject, merge, timeout, map, catchError, throwError, from, firstValueFrom, share, concatMap, of, timer, takeUntil, filter, take } from 'rxjs';
|
|
28
|
+
import { BehaviorSubject, merge, timeout, map, catchError, throwError, from, firstValueFrom, share, concatMap, of, timer, takeUntil, Subject, filter, take } from 'rxjs';
|
|
29
29
|
import { SETTINGS_PANEL_DATA } from '@praxisui/settings-panel';
|
|
30
30
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
31
31
|
import * as i7 from '@angular/material/tabs';
|
|
@@ -2549,12 +2549,12 @@ const PRAXIS_PAGE_BUILDER_EN_US = {
|
|
|
2549
2549
|
'praxis.pageBuilder.agentic.header.title.widget': 'Praxis widget copilot',
|
|
2550
2550
|
'praxis.pageBuilder.agentic.header.title.review': 'Praxis review copilot',
|
|
2551
2551
|
'praxis.pageBuilder.agentic.header.title.governed': 'Praxis governed copilot',
|
|
2552
|
-
'praxis.pageBuilder.agentic.header.subtitle.page': 'Turn
|
|
2553
|
-
'praxis.pageBuilder.agentic.header.subtitle.route': '
|
|
2552
|
+
'praxis.pageBuilder.agentic.header.subtitle.page': 'Turn a domain need into a table, form, or dashboard.',
|
|
2553
|
+
'praxis.pageBuilder.agentic.header.subtitle.route': 'Creating or adjusting page {route}.',
|
|
2554
2554
|
'praxis.pageBuilder.agentic.header.subtitle.widget': 'Focused on {target}.',
|
|
2555
|
-
'praxis.pageBuilder.agentic.header.subtitle.reviewBlocked': 'Preview ready
|
|
2556
|
-
'praxis.pageBuilder.agentic.header.subtitle.review': 'Preview ready
|
|
2557
|
-
'praxis.pageBuilder.agentic.header.subtitle.governed': 'Continue the
|
|
2555
|
+
'praxis.pageBuilder.agentic.header.subtitle.reviewBlocked': 'Preview ready, with points to review.',
|
|
2556
|
+
'praxis.pageBuilder.agentic.header.subtitle.review': 'Preview ready to review and save.',
|
|
2557
|
+
'praxis.pageBuilder.agentic.header.subtitle.governed': 'Continue the rule review before creating the screen.',
|
|
2558
2558
|
'praxis.pageBuilder.agentic.header.mode.page': 'Page',
|
|
2559
2559
|
'praxis.pageBuilder.agentic.header.mode.widget': 'Widget',
|
|
2560
2560
|
'praxis.pageBuilder.agentic.header.mode.governed': 'Governed',
|
|
@@ -2570,13 +2570,13 @@ const PRAXIS_PAGE_BUILDER_EN_US = {
|
|
|
2570
2570
|
'praxis.pageBuilder.agentic.dock.badgeGoverned': 'Governed',
|
|
2571
2571
|
'praxis.pageBuilder.agentic.dock.badgeReady': 'Ready',
|
|
2572
2572
|
'praxis.pageBuilder.agentic.dock.summaryReview': 'Preview ready. Reopen to review or save.',
|
|
2573
|
-
'praxis.pageBuilder.agentic.dock.summaryGoverned': '
|
|
2573
|
+
'praxis.pageBuilder.agentic.dock.summaryGoverned': 'Review preserved. Continue where you left off.',
|
|
2574
2574
|
'praxis.pageBuilder.agentic.dock.summaryIdle': 'Conversation preserved. Continue where you stopped.',
|
|
2575
2575
|
'praxis.pageBuilder.agentic.promptLabel': 'Message',
|
|
2576
2576
|
'praxis.pageBuilder.agentic.promptPlaceholder': 'Describe the page, dashboard, form, or change you need.',
|
|
2577
2577
|
'praxis.pageBuilder.agentic.emptyConversation': 'Describe the outcome you want. I will ground the context, prepare a governed preview, and wait for review before applying anything.',
|
|
2578
|
-
'praxis.pageBuilder.agentic.emptyConversation.blankGeneric': 'This
|
|
2579
|
-
'praxis.pageBuilder.agentic.emptyConversation.existingPage': 'Tell me what you want to improve
|
|
2578
|
+
'praxis.pageBuilder.agentic.emptyConversation.blankGeneric': 'This screen is still empty. Tell me which domain activity it should support. I can suggest a dashboard, table, or form and prepare a preview for you to review before saving.',
|
|
2579
|
+
'praxis.pageBuilder.agentic.emptyConversation.existingPage': 'Tell me what you want to improve on this screen. I will read what already exists and prepare a preview for you to review before saving.',
|
|
2580
2580
|
'praxis.pageBuilder.agentic.conversationAria': 'AI conversation',
|
|
2581
2581
|
'praxis.pageBuilder.agentic.quickRepliesAria': 'Quick replies',
|
|
2582
2582
|
'praxis.pageBuilder.agentic.contextAria': 'Active context',
|
|
@@ -2692,8 +2692,39 @@ const PRAXIS_PAGE_BUILDER_EN_US = {
|
|
|
2692
2692
|
'praxis.pageBuilder.agentic.status.acceptedRelabelField': 'Field label updated.',
|
|
2693
2693
|
'praxis.pageBuilder.agentic.status.saving': 'Saving page...',
|
|
2694
2694
|
'praxis.pageBuilder.agentic.status.saved': 'Page saved.',
|
|
2695
|
-
'praxis.pageBuilder.agentic.status.sharedRuleTargetSelected': '
|
|
2696
|
-
'praxis.pageBuilder.agentic.
|
|
2695
|
+
'praxis.pageBuilder.agentic.status.sharedRuleTargetSelected': 'Continue this request in the rule review.',
|
|
2696
|
+
'praxis.pageBuilder.agentic.governedRoute.streamUnavailable': 'This request needs to continue through governed business-rule review. I will not create a local preview while that review is unavailable.',
|
|
2697
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.title': 'Governed rule review',
|
|
2698
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.description': 'Review the business rule before creating or saving screen changes.',
|
|
2699
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.expand': 'Expand',
|
|
2700
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.collapse': 'Collapse',
|
|
2701
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.targetSelected': 'Rule identified. The next safe step is reviewing the rule before creating the screen.',
|
|
2702
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.running': 'Running review step',
|
|
2703
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.definitionId': 'Rule',
|
|
2704
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.simulation': 'Simulation',
|
|
2705
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.publication': 'Publication',
|
|
2706
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.materializations': 'Created screens',
|
|
2707
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.timeline': 'History',
|
|
2708
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.enforcementState': 'Validation',
|
|
2709
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.enforcementMatrix': 'Change validation',
|
|
2710
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.enforcementMatrixDescription': 'Changes the platform can apply after publication.',
|
|
2711
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.pending': 'pending',
|
|
2712
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.applied': 'applied',
|
|
2713
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.waiting': 'waiting',
|
|
2714
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.open_definition.label': 'Review rule',
|
|
2715
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.open_definition.description': 'Open or create the governed rule review.',
|
|
2716
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.simulate.label': 'Simulate',
|
|
2717
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.simulate.description': 'Test the result before publishing.',
|
|
2718
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.approve.label': 'Approve',
|
|
2719
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.approve.description': 'Approve the rule after review.',
|
|
2720
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.publish.label': 'Publish changes',
|
|
2721
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.publish.description': 'Publish the rule and prepare derived screens.',
|
|
2722
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.materialize.label': 'View created screens',
|
|
2723
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.materialize.description': 'View the screens generated from the approved rule.',
|
|
2724
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.validate_enforcement.label': 'Validate application',
|
|
2725
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.validate_enforcement.description': 'Check whether published changes are ready to use.',
|
|
2726
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.open_timeline.label': 'View history',
|
|
2727
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.open_timeline.description': 'Open the safe history for this decision.',
|
|
2697
2728
|
'praxis.pageBuilder.agentic.projectKnowledgeCockpit.timeline': 'Safe timeline',
|
|
2698
2729
|
'praxis.pageBuilder.agentic.projectKnowledgeCockpit.timelineEmpty': 'No safe timeline events published for this change-set yet.',
|
|
2699
2730
|
'praxis.pageBuilder.agentic.projectKnowledgeCockpit.rejected': 'Project Knowledge change-set rejected. No governed knowledge projection was applied.',
|
|
@@ -2704,7 +2735,6 @@ const PRAXIS_PAGE_BUILDER_EN_US = {
|
|
|
2704
2735
|
'praxis.pageBuilder.agentic.errors.streamTimeout': 'The assistant took too long to finish this request. Try again with a narrower request or review the active context.',
|
|
2705
2736
|
'praxis.pageBuilder.agentic.errors.streamProcessing': 'The assistant could not finish this authoring request. Try again or ask support to review the diagnostics.',
|
|
2706
2737
|
'praxis.pageBuilder.agentic.errors.streamConnection': 'The assistant stream was interrupted before the turn finished. Try again or ask support to check the stream connection.',
|
|
2707
|
-
'praxis.pageBuilder.agentic.governedRoute.streamUnavailable': 'This request must continue through the governed semantic-decision flow in /api/praxis/config/domain-rules. The backend stream is unavailable, so local preview/apply is blocked.',
|
|
2708
2738
|
'praxis.pageBuilder.agentic.errors.duplicateField': 'This field already exists in the selected form.',
|
|
2709
2739
|
'praxis.pageBuilder.agentic.errors.nonLocalFieldRemoval': 'Only local fields created by AI can be removed in this flow.',
|
|
2710
2740
|
'praxis.pageBuilder.agentic.errors.invalidTableContract': 'I found the data source, but the generated plan used properties that are incompatible with the table component. I will adjust it to use only supported fields.',
|
|
@@ -2993,12 +3023,12 @@ const PRAXIS_PAGE_BUILDER_PT_BR = {
|
|
|
2993
3023
|
'praxis.pageBuilder.agentic.header.title.widget': 'Copiloto de componente Praxis',
|
|
2994
3024
|
'praxis.pageBuilder.agentic.header.title.review': 'Copiloto de revisão Praxis',
|
|
2995
3025
|
'praxis.pageBuilder.agentic.header.title.governed': 'Copiloto governado Praxis',
|
|
2996
|
-
'praxis.pageBuilder.agentic.header.subtitle.page': 'Transforme
|
|
2997
|
-
'praxis.pageBuilder.agentic.header.subtitle.route': '
|
|
3026
|
+
'praxis.pageBuilder.agentic.header.subtitle.page': 'Transforme uma necessidade do domínio em tabela, formulário ou painel.',
|
|
3027
|
+
'praxis.pageBuilder.agentic.header.subtitle.route': 'Criando ou ajustando a página {route}.',
|
|
2998
3028
|
'praxis.pageBuilder.agentic.header.subtitle.widget': 'Foco em {target}.',
|
|
2999
|
-
'praxis.pageBuilder.agentic.header.subtitle.reviewBlocked': 'Prévia pronta para
|
|
3000
|
-
'praxis.pageBuilder.agentic.header.subtitle.review': 'Prévia pronta para
|
|
3001
|
-
'praxis.pageBuilder.agentic.header.subtitle.governed': 'Continue
|
|
3029
|
+
'praxis.pageBuilder.agentic.header.subtitle.reviewBlocked': 'Prévia pronta, com pontos para revisar.',
|
|
3030
|
+
'praxis.pageBuilder.agentic.header.subtitle.review': 'Prévia pronta para revisar e salvar.',
|
|
3031
|
+
'praxis.pageBuilder.agentic.header.subtitle.governed': 'Continue a revisão da regra antes de criar a tela.',
|
|
3002
3032
|
'praxis.pageBuilder.agentic.header.mode.page': 'Página',
|
|
3003
3033
|
'praxis.pageBuilder.agentic.header.mode.widget': 'Widget',
|
|
3004
3034
|
'praxis.pageBuilder.agentic.header.mode.governed': 'Governado',
|
|
@@ -3014,13 +3044,13 @@ const PRAXIS_PAGE_BUILDER_PT_BR = {
|
|
|
3014
3044
|
'praxis.pageBuilder.agentic.dock.badgeGoverned': 'Governado',
|
|
3015
3045
|
'praxis.pageBuilder.agentic.dock.badgeReady': 'Pronto',
|
|
3016
3046
|
'praxis.pageBuilder.agentic.dock.summaryReview': 'Prévia pronta. Reabra para revisar ou salvar.',
|
|
3017
|
-
'praxis.pageBuilder.agentic.dock.summaryGoverned': '
|
|
3047
|
+
'praxis.pageBuilder.agentic.dock.summaryGoverned': 'Revisão preservada. Continue de onde parou.',
|
|
3018
3048
|
'praxis.pageBuilder.agentic.dock.summaryIdle': 'Conversa preservada. Continue de onde parou.',
|
|
3019
3049
|
'praxis.pageBuilder.agentic.promptLabel': 'Mensagem',
|
|
3020
3050
|
'praxis.pageBuilder.agentic.promptPlaceholder': 'Descreva a página, dashboard, formulário ou alteração que você precisa.',
|
|
3021
3051
|
'praxis.pageBuilder.agentic.emptyConversation': 'Descreva o resultado que você quer. Vou fundamentar o contexto, preparar uma prévia governada e aguardar revisão antes de aplicar qualquer mudança.',
|
|
3022
|
-
'praxis.pageBuilder.agentic.emptyConversation.blankGeneric': 'Esta
|
|
3023
|
-
'praxis.pageBuilder.agentic.emptyConversation.existingPage': '
|
|
3052
|
+
'praxis.pageBuilder.agentic.emptyConversation.blankGeneric': 'Esta tela ainda está vazia. Diga qual atividade do domínio ela precisa apoiar. Posso sugerir um painel, tabela ou formulário e montar uma prévia para você revisar antes de salvar.',
|
|
3053
|
+
'praxis.pageBuilder.agentic.emptyConversation.existingPage': 'Diga o que você quer melhorar nesta tela. Eu leio o que já existe e preparo uma prévia para você revisar antes de salvar.',
|
|
3024
3054
|
'praxis.pageBuilder.agentic.conversationAria': 'Conversa com IA',
|
|
3025
3055
|
'praxis.pageBuilder.agentic.quickRepliesAria': 'Respostas rápidas',
|
|
3026
3056
|
'praxis.pageBuilder.agentic.contextAria': 'Contexto ativo',
|
|
@@ -3136,8 +3166,39 @@ const PRAXIS_PAGE_BUILDER_PT_BR = {
|
|
|
3136
3166
|
'praxis.pageBuilder.agentic.status.acceptedRelabelField': 'Rótulo do campo atualizado.',
|
|
3137
3167
|
'praxis.pageBuilder.agentic.status.saving': 'Salvando página...',
|
|
3138
3168
|
'praxis.pageBuilder.agentic.status.saved': 'Página salva.',
|
|
3139
|
-
'praxis.pageBuilder.agentic.status.sharedRuleTargetSelected': '
|
|
3140
|
-
'praxis.pageBuilder.agentic.
|
|
3169
|
+
'praxis.pageBuilder.agentic.status.sharedRuleTargetSelected': 'Continue este pedido na revisão da regra.',
|
|
3170
|
+
'praxis.pageBuilder.agentic.governedRoute.streamUnavailable': 'Este pedido precisa continuar pela revisão governada da regra de negócio. Não vou criar uma prévia local enquanto essa revisão não estiver disponível.',
|
|
3171
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.title': 'Revisão governada da regra',
|
|
3172
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.description': 'Revise a regra de negócio antes de criar ou salvar alterações na tela.',
|
|
3173
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.expand': 'Expandir',
|
|
3174
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.collapse': 'Recolher',
|
|
3175
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.targetSelected': 'Regra identificada. O próximo passo seguro é revisar a regra antes de criar a tela.',
|
|
3176
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.running': 'Executando etapa de revisão',
|
|
3177
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.definitionId': 'Regra',
|
|
3178
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.simulation': 'Simulação',
|
|
3179
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.publication': 'Publicação',
|
|
3180
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.materializations': 'Telas criadas',
|
|
3181
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.timeline': 'Histórico',
|
|
3182
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.enforcementState': 'Validação',
|
|
3183
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.enforcementMatrix': 'Validação das alterações',
|
|
3184
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.enforcementMatrixDescription': 'Alterações que a plataforma poderá aplicar depois da publicação.',
|
|
3185
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.pending': 'pendente',
|
|
3186
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.applied': 'aplicadas',
|
|
3187
|
+
'praxis.pageBuilder.agentic.sharedRuleCockpit.waiting': 'aguardando',
|
|
3188
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.open_definition.label': 'Revisar regra',
|
|
3189
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.open_definition.description': 'Abrir ou criar a revisão governada da regra.',
|
|
3190
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.simulate.label': 'Simular',
|
|
3191
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.simulate.description': 'Testar o resultado antes de publicar.',
|
|
3192
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.approve.label': 'Aprovar',
|
|
3193
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.approve.description': 'Aprovar a regra depois da revisão.',
|
|
3194
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.publish.label': 'Publicar alterações',
|
|
3195
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.publish.description': 'Publicar a regra e preparar as telas derivadas.',
|
|
3196
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.materialize.label': 'Ver telas criadas',
|
|
3197
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.materialize.description': 'Ver as telas geradas a partir da regra aprovada.',
|
|
3198
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.validate_enforcement.label': 'Validar aplicação',
|
|
3199
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.validate_enforcement.description': 'Verificar se as alterações publicadas já podem ser usadas.',
|
|
3200
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.open_timeline.label': 'Ver histórico',
|
|
3201
|
+
'praxis.pageBuilder.agentic.governedContinuation.sharedRule.open_timeline.description': 'Abrir o histórico seguro desta decisão.',
|
|
3141
3202
|
'praxis.pageBuilder.agentic.projectKnowledgeCockpit.timeline': 'Timeline segura',
|
|
3142
3203
|
'praxis.pageBuilder.agentic.projectKnowledgeCockpit.timelineEmpty': 'Ainda não há eventos seguros de timeline publicados para este change-set.',
|
|
3143
3204
|
'praxis.pageBuilder.agentic.projectKnowledgeCockpit.rejected': 'Change-set de Project Knowledge rejeitado. Nenhuma projeção de conhecimento governado foi aplicada.',
|
|
@@ -3148,7 +3209,6 @@ const PRAXIS_PAGE_BUILDER_PT_BR = {
|
|
|
3148
3209
|
'praxis.pageBuilder.agentic.errors.streamTimeout': 'Ainda não consegui concluir este pedido. Tente novamente com um pedido mais específico ou revise o contexto ativo.',
|
|
3149
3210
|
'praxis.pageBuilder.agentic.errors.streamProcessing': 'Não consegui concluir este pedido de autoria. Tente novamente ou peça ao suporte para revisar o diagnóstico.',
|
|
3150
3211
|
'praxis.pageBuilder.agentic.errors.streamConnection': 'O stream do assistente foi interrompido antes de concluir o turno. Tente novamente ou acione o suporte para verificar a conexão do stream.',
|
|
3151
|
-
'praxis.pageBuilder.agentic.governedRoute.streamUnavailable': 'Este pedido deve continuar pelo fluxo governado de decisão semântica em /api/praxis/config/domain-rules. O stream do backend está indisponível, então pré-visualização/aplicação local fica bloqueada.',
|
|
3152
3212
|
'praxis.pageBuilder.agentic.errors.duplicateField': 'Este campo já existe no formulário selecionado.',
|
|
3153
3213
|
'praxis.pageBuilder.agentic.errors.nonLocalFieldRemoval': 'Somente campos locais criados pela IA podem ser removidos neste fluxo.',
|
|
3154
3214
|
'praxis.pageBuilder.agentic.errors.invalidTableContract': 'Encontrei a fonte de dados, mas o plano gerado usou propriedades incompatíveis com o componente de tabela. Vou ajustar para usar apenas os campos suportados.',
|
|
@@ -13864,6 +13924,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
13864
13924
|
service;
|
|
13865
13925
|
context;
|
|
13866
13926
|
mode = 'agentic-authoring';
|
|
13927
|
+
runtimeRelatedSurfaceDisambiguationContext = null;
|
|
13867
13928
|
constructor(service, context) {
|
|
13868
13929
|
this.service = service;
|
|
13869
13930
|
this.context = context;
|
|
@@ -14071,7 +14132,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
14071
14132
|
phase: 'contextualize',
|
|
14072
14133
|
assistantMessage: undefined,
|
|
14073
14134
|
canApply: false,
|
|
14074
|
-
statusText: this.context.tx('agentic.status.preparingTurnStream', '
|
|
14135
|
+
statusText: this.context.tx('agentic.status.preparingTurnStream', 'Organizando as informações do pedido...'),
|
|
14075
14136
|
errorText: '',
|
|
14076
14137
|
preview: null,
|
|
14077
14138
|
};
|
|
@@ -14082,7 +14143,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
14082
14143
|
phase: 'contextualize',
|
|
14083
14144
|
assistantMessage: undefined,
|
|
14084
14145
|
canApply: false,
|
|
14085
|
-
statusText: this.context.tx('agentic.status.turnStreamContextReady', '
|
|
14146
|
+
statusText: this.context.tx('agentic.status.turnStreamContextReady', 'Informações prontas. Preparando a resposta...'),
|
|
14086
14147
|
errorText: '',
|
|
14087
14148
|
preview: null,
|
|
14088
14149
|
diagnostics: {
|
|
@@ -14096,7 +14157,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
14096
14157
|
phase: 'contextualize',
|
|
14097
14158
|
assistantMessage: undefined,
|
|
14098
14159
|
canApply: false,
|
|
14099
|
-
statusText: this.context.tx('agentic.status.preparingTurnStreamWaiting', '
|
|
14160
|
+
statusText: this.context.tx('agentic.status.preparingTurnStreamWaiting', 'Ainda conferindo domínio, tela atual e fontes disponíveis...'),
|
|
14100
14161
|
errorText: '',
|
|
14101
14162
|
preview: null,
|
|
14102
14163
|
diagnostics: {
|
|
@@ -14112,7 +14173,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
14112
14173
|
return {
|
|
14113
14174
|
state: 'listening',
|
|
14114
14175
|
phase: 'capture',
|
|
14115
|
-
assistantMessage: this.context.tx('agentic.status.cancelled', '
|
|
14176
|
+
assistantMessage: this.context.tx('agentic.status.cancelled', 'Pedido cancelado.'),
|
|
14116
14177
|
quickReplies: [],
|
|
14117
14178
|
canApply: false,
|
|
14118
14179
|
statusText: '',
|
|
@@ -15008,6 +15069,77 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15008
15069
|
}
|
|
15009
15070
|
return JSON.parse(JSON.stringify(value));
|
|
15010
15071
|
}
|
|
15072
|
+
captureRuntimeRelatedSurfaceDisambiguationContext(payload, event) {
|
|
15073
|
+
const disambiguation = this.findRuntimeRelatedSurfaceDisambiguation(payload);
|
|
15074
|
+
const rawOptions = Array.isArray(disambiguation?.['options'])
|
|
15075
|
+
? disambiguation['options']
|
|
15076
|
+
: [];
|
|
15077
|
+
const options = rawOptions
|
|
15078
|
+
.map((option) => this.toJsonObject(option))
|
|
15079
|
+
.filter((option) => !!option)
|
|
15080
|
+
.filter((option) => !!this.readString(option, 'surfaceRef')
|
|
15081
|
+
&& this.readString(option, 'optionRef') === `runtime-surface-option:${this.readString(option, 'surfaceRef')}`
|
|
15082
|
+
&& this.readString(option, 'candidateRef').startsWith('runtime-surface-candidate:'))
|
|
15083
|
+
.slice(0, 4)
|
|
15084
|
+
.map((option) => ({
|
|
15085
|
+
surfaceRef: this.readString(option, 'surfaceRef'),
|
|
15086
|
+
optionRef: this.readString(option, 'optionRef'),
|
|
15087
|
+
candidateRef: this.readString(option, 'candidateRef'),
|
|
15088
|
+
label: this.readString(option, 'label') || this.readString(option, 'surfaceRef'),
|
|
15089
|
+
semanticAliases: Array.isArray(option['semanticAliases'])
|
|
15090
|
+
? option['semanticAliases']
|
|
15091
|
+
.filter((alias) => typeof alias === 'string' && !!alias.trim())
|
|
15092
|
+
.map((alias) => alias.trim())
|
|
15093
|
+
.slice(0, 12)
|
|
15094
|
+
: [],
|
|
15095
|
+
}));
|
|
15096
|
+
if (options.length < 2) {
|
|
15097
|
+
return;
|
|
15098
|
+
}
|
|
15099
|
+
const evidenceBundle = this.toJsonObject(payload['evidenceBundle']);
|
|
15100
|
+
const runtimeContext = this.toJsonObject(evidenceBundle?.['runtimeConsultableContext'])
|
|
15101
|
+
?? this.toJsonObject(evidenceBundle?.['runtimeContext'])
|
|
15102
|
+
?? null;
|
|
15103
|
+
this.runtimeRelatedSurfaceDisambiguationContext = {
|
|
15104
|
+
schemaVersion: 'praxis-runtime-related-surface-disambiguation-context.v1',
|
|
15105
|
+
source: 'runtimeRelatedSurfaceDisambiguation',
|
|
15106
|
+
authority: 'grounding_only',
|
|
15107
|
+
sessionId: event?.threadId ?? '',
|
|
15108
|
+
sourceTurnId: event?.turnId ?? '',
|
|
15109
|
+
pageId: this.readString(runtimeContext, 'pageId'),
|
|
15110
|
+
capturedAt: new Date().toISOString(),
|
|
15111
|
+
ttlMs: 300000,
|
|
15112
|
+
optionCount: options.length,
|
|
15113
|
+
options,
|
|
15114
|
+
rawRuntimeValuesCopied: false,
|
|
15115
|
+
};
|
|
15116
|
+
}
|
|
15117
|
+
findRuntimeRelatedSurfaceDisambiguation(value) {
|
|
15118
|
+
const root = this.toJsonObject(value);
|
|
15119
|
+
if (!root) {
|
|
15120
|
+
return null;
|
|
15121
|
+
}
|
|
15122
|
+
if (root['schemaVersion'] === 'praxis-runtime-related-surface-disambiguation.v1') {
|
|
15123
|
+
return root;
|
|
15124
|
+
}
|
|
15125
|
+
for (const child of Object.values(root)) {
|
|
15126
|
+
if (Array.isArray(child)) {
|
|
15127
|
+
for (const item of child) {
|
|
15128
|
+
const found = this.findRuntimeRelatedSurfaceDisambiguation(item);
|
|
15129
|
+
if (found) {
|
|
15130
|
+
return found;
|
|
15131
|
+
}
|
|
15132
|
+
}
|
|
15133
|
+
}
|
|
15134
|
+
else {
|
|
15135
|
+
const found = this.findRuntimeRelatedSurfaceDisambiguation(child);
|
|
15136
|
+
if (found) {
|
|
15137
|
+
return found;
|
|
15138
|
+
}
|
|
15139
|
+
}
|
|
15140
|
+
}
|
|
15141
|
+
return null;
|
|
15142
|
+
}
|
|
15011
15143
|
async buildTurnStreamRequest(request, prompt) {
|
|
15012
15144
|
const startedAt = Date.now();
|
|
15013
15145
|
const capabilitiesStartedAt = Date.now();
|
|
@@ -15017,6 +15149,9 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15017
15149
|
const selectedWidgetKey = this.context.selectedWidgetKey();
|
|
15018
15150
|
const authoringContext = this.buildAuthoringContext(request);
|
|
15019
15151
|
const authoringContextElapsedMs = Math.max(0, Date.now() - authoringContextStartedAt);
|
|
15152
|
+
const runtimeObservationsStartedAt = Date.now();
|
|
15153
|
+
const runtimeObservationResult = await this.collectRuntimeComponentObservations(request);
|
|
15154
|
+
const runtimeObservationsElapsedMs = Math.max(0, Date.now() - runtimeObservationsStartedAt);
|
|
15020
15155
|
const streamRequest = {
|
|
15021
15156
|
userPrompt: prompt,
|
|
15022
15157
|
targetApp: this.context.targetApp,
|
|
@@ -15029,6 +15164,19 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15029
15164
|
apiKey: this.context.apiKey(),
|
|
15030
15165
|
componentCapabilities,
|
|
15031
15166
|
...authoringContext,
|
|
15167
|
+
...(this.runtimeRelatedSurfaceDisambiguationContext
|
|
15168
|
+
? {
|
|
15169
|
+
diagnostics: {
|
|
15170
|
+
runtimeRelatedSurfaceDisambiguationContext: this.cloneJsonObject(this.runtimeRelatedSurfaceDisambiguationContext),
|
|
15171
|
+
},
|
|
15172
|
+
}
|
|
15173
|
+
: {}),
|
|
15174
|
+
...(runtimeObservationResult.observations.length
|
|
15175
|
+
? {
|
|
15176
|
+
runtimeComponentObservations: runtimeObservationResult.observations,
|
|
15177
|
+
runtimeComponentObservationTrustBoundary: 'untrusted_frontend_observation',
|
|
15178
|
+
}
|
|
15179
|
+
: {}),
|
|
15032
15180
|
};
|
|
15033
15181
|
return {
|
|
15034
15182
|
streamRequest,
|
|
@@ -15038,19 +15186,49 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15038
15186
|
totalElapsedMs: Math.max(0, Date.now() - startedAt),
|
|
15039
15187
|
capabilitiesElapsedMs,
|
|
15040
15188
|
authoringContextElapsedMs,
|
|
15189
|
+
runtimeObservationsElapsedMs,
|
|
15041
15190
|
catalogCount: componentCapabilities.catalogs?.length ?? 0,
|
|
15042
15191
|
capabilityCount: componentCapabilities.catalogs
|
|
15043
15192
|
.reduce((count, catalog) => count + (catalog.capabilities?.length ?? 0), 0),
|
|
15044
15193
|
attachmentCount: authoringContext.attachmentSummaries?.length ?? 0,
|
|
15045
15194
|
hasPendingClarification: !!authoringContext.pendingClarification,
|
|
15046
15195
|
hasContextHints: !!authoringContext.contextHints,
|
|
15196
|
+
runtimeObservationCount: runtimeObservationResult.observations.length,
|
|
15197
|
+
runtimeObservationSource: runtimeObservationResult.source,
|
|
15198
|
+
runtimeObservationUnavailable: runtimeObservationResult.unavailable,
|
|
15047
15199
|
},
|
|
15048
15200
|
};
|
|
15049
15201
|
}
|
|
15202
|
+
async collectRuntimeComponentObservations(request) {
|
|
15203
|
+
try {
|
|
15204
|
+
const collected = await this.context.collectRuntimeComponentObservations?.();
|
|
15205
|
+
if (collected?.length) {
|
|
15206
|
+
return {
|
|
15207
|
+
observations: collected,
|
|
15208
|
+
source: 'page-builder-explicit',
|
|
15209
|
+
unavailable: false,
|
|
15210
|
+
};
|
|
15211
|
+
}
|
|
15212
|
+
}
|
|
15213
|
+
catch {
|
|
15214
|
+
const fallback = request.runtimeComponentObservations || [];
|
|
15215
|
+
return {
|
|
15216
|
+
observations: fallback,
|
|
15217
|
+
source: fallback.length ? 'assistant-request' : 'none',
|
|
15218
|
+
unavailable: true,
|
|
15219
|
+
};
|
|
15220
|
+
}
|
|
15221
|
+
const fallback = request.runtimeComponentObservations || [];
|
|
15222
|
+
return {
|
|
15223
|
+
observations: fallback,
|
|
15224
|
+
source: fallback.length ? 'assistant-request' : 'none',
|
|
15225
|
+
unavailable: false,
|
|
15226
|
+
};
|
|
15227
|
+
}
|
|
15050
15228
|
async toTurnResultFromStreamEvent(event, request, prompt) {
|
|
15051
15229
|
const payload = this.toJsonObject(event.payload) ?? {};
|
|
15052
15230
|
if (event.type === 'result') {
|
|
15053
|
-
return this.toResultTurnFromStreamPayload(payload, request, prompt);
|
|
15231
|
+
return this.toResultTurnFromStreamPayload(payload, request, prompt, event);
|
|
15054
15232
|
}
|
|
15055
15233
|
if (event.type === 'error') {
|
|
15056
15234
|
const message = this.describeStreamError(payload);
|
|
@@ -15069,7 +15247,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15069
15247
|
return {
|
|
15070
15248
|
state: 'listening',
|
|
15071
15249
|
phase: 'capture',
|
|
15072
|
-
assistantMessage: this.context.tx('agentic.status.cancelled', '
|
|
15250
|
+
assistantMessage: this.context.tx('agentic.status.cancelled', 'Pedido cancelado.'),
|
|
15073
15251
|
quickReplies: [],
|
|
15074
15252
|
canApply: false,
|
|
15075
15253
|
statusText: '',
|
|
@@ -15088,7 +15266,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15088
15266
|
preview: null,
|
|
15089
15267
|
};
|
|
15090
15268
|
}
|
|
15091
|
-
async toResultTurnFromStreamPayload(payload, request, prompt) {
|
|
15269
|
+
async toResultTurnFromStreamPayload(payload, request, prompt, event) {
|
|
15092
15270
|
const intentResolution = this.normalizeIntentResolutionResult(payload['intentResolution']);
|
|
15093
15271
|
const preview = payload['preview'];
|
|
15094
15272
|
if (!intentResolution) {
|
|
@@ -15110,6 +15288,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15110
15288
|
? payload['quickReplies']
|
|
15111
15289
|
: intentResolution.quickReplies ?? [];
|
|
15112
15290
|
const quickReplies = this.resolveShellQuickReplies(intentResolution, rawQuickReplies);
|
|
15291
|
+
this.captureRuntimeRelatedSurfaceDisambiguationContext(payload, event);
|
|
15113
15292
|
const assistantMessage = this.normalizeAssistantMessageForQuickReplies(rawAssistantMessage, quickReplies);
|
|
15114
15293
|
const canApply = payload['canApply'] === true && !!preview?.valid;
|
|
15115
15294
|
const contextualExecutableIntent = request
|
|
@@ -15821,23 +16000,23 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15821
16000
|
describeDashboardQualityWarning(code) {
|
|
15822
16001
|
switch (code) {
|
|
15823
16002
|
case 'dashboard-without-chart-widget':
|
|
15824
|
-
return this.context.tx('agentic.dashboardQuality.warning.chart', '
|
|
16003
|
+
return this.context.tx('agentic.dashboardQuality.warning.chart', 'faltou um gráfico');
|
|
15825
16004
|
case 'dashboard-without-kpi-widget':
|
|
15826
|
-
return this.context.tx('agentic.dashboardQuality.warning.kpi', '
|
|
16005
|
+
return this.context.tx('agentic.dashboardQuality.warning.kpi', 'faltaram indicadores');
|
|
15827
16006
|
case 'dashboard-kpi-placeholder-values':
|
|
15828
|
-
return this.context.tx('agentic.dashboardQuality.warning.kpiValues', '
|
|
16007
|
+
return this.context.tx('agentic.dashboardQuality.warning.kpiValues', 'indicadores ainda estão sem dados reais');
|
|
15829
16008
|
case 'dashboard-without-filter-widget':
|
|
15830
|
-
return this.context.tx('agentic.dashboardQuality.warning.filter', '
|
|
16009
|
+
return this.context.tx('agentic.dashboardQuality.warning.filter', 'faltaram filtros');
|
|
15831
16010
|
case 'dashboard-without-record-detail-widget':
|
|
15832
|
-
return this.context.tx('agentic.dashboardQuality.warning.details', '
|
|
16011
|
+
return this.context.tx('agentic.dashboardQuality.warning.details', 'faltou uma área de detalhe');
|
|
15833
16012
|
case 'dashboard-without-composition-links':
|
|
15834
|
-
return this.context.tx('agentic.dashboardQuality.warning.links', '
|
|
16013
|
+
return this.context.tx('agentic.dashboardQuality.warning.links', 'faltou conectar as partes do painel');
|
|
15835
16014
|
case 'dashboard-filter-not-connected':
|
|
15836
|
-
return this.context.tx('agentic.dashboardQuality.warning.filterConnection', '
|
|
16015
|
+
return this.context.tx('agentic.dashboardQuality.warning.filterConnection', 'o filtro ainda não controla o painel');
|
|
15837
16016
|
case 'dashboard-chart-not-interactive':
|
|
15838
|
-
return this.context.tx('agentic.dashboardQuality.warning.chartInteraction', '
|
|
16017
|
+
return this.context.tx('agentic.dashboardQuality.warning.chartInteraction', 'o gráfico ainda não abre detalhes');
|
|
15839
16018
|
case 'dashboard-without-surface-actions':
|
|
15840
|
-
return this.context.tx('agentic.dashboardQuality.warning.surfaces', '
|
|
16019
|
+
return this.context.tx('agentic.dashboardQuality.warning.surfaces', 'faltaram ações para consultar detalhes');
|
|
15841
16020
|
default:
|
|
15842
16021
|
return code;
|
|
15843
16022
|
}
|
|
@@ -15883,8 +16062,8 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15883
16062
|
if (warnings.includes('dashboard-without-kpi-widget')) {
|
|
15884
16063
|
replies.push(this.dashboardQualityQuickReply({
|
|
15885
16064
|
id: 'dashboard-quality-add-kpis',
|
|
15886
|
-
label: this.context.tx('agentic.dashboardQuality.quickReply.addKpis', '
|
|
15887
|
-
prompt: this.context.tx('agentic.dashboardQuality.prompt.addKpis', '
|
|
16065
|
+
label: this.context.tx('agentic.dashboardQuality.quickReply.addKpis', 'Adicionar indicadores'),
|
|
16066
|
+
prompt: this.context.tx('agentic.dashboardQuality.prompt.addKpis', 'Inclua um bloco compacto com os indicadores mais úteis para acompanhar esse painel.'),
|
|
15888
16067
|
icon: 'monitoring',
|
|
15889
16068
|
changeKind: 'add_dashboard_kpis',
|
|
15890
16069
|
contextHints,
|
|
@@ -15893,8 +16072,8 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15893
16072
|
if (warnings.includes('dashboard-kpi-placeholder-values')) {
|
|
15894
16073
|
replies.push(this.dashboardQualityQuickReply({
|
|
15895
16074
|
id: 'dashboard-quality-bind-kpis',
|
|
15896
|
-
label: this.context.tx('agentic.dashboardQuality.quickReply.bindKpis', '
|
|
15897
|
-
prompt: this.context.tx('agentic.dashboardQuality.prompt.bindKpis', '
|
|
16075
|
+
label: this.context.tx('agentic.dashboardQuality.quickReply.bindKpis', 'Usar dados reais nos indicadores'),
|
|
16076
|
+
prompt: this.context.tx('agentic.dashboardQuality.prompt.bindKpis', 'Substitua valores de exemplo dos indicadores por dados reais da fonte escolhida, mantendo nomes e formatos fáceis de entender.'),
|
|
15898
16077
|
icon: 'data_object',
|
|
15899
16078
|
changeKind: 'bind_dashboard_kpis',
|
|
15900
16079
|
contextHints,
|
|
@@ -15903,8 +16082,8 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15903
16082
|
if (warnings.includes('dashboard-without-filter-widget')) {
|
|
15904
16083
|
replies.push(this.dashboardQualityQuickReply({
|
|
15905
16084
|
id: 'dashboard-quality-add-filters',
|
|
15906
|
-
label: this.context.tx('agentic.dashboardQuality.quickReply.addFilters', '
|
|
15907
|
-
prompt: this.context.tx('agentic.dashboardQuality.prompt.addFilters', '
|
|
16085
|
+
label: this.context.tx('agentic.dashboardQuality.quickReply.addFilters', 'Adicionar filtros'),
|
|
16086
|
+
prompt: this.context.tx('agentic.dashboardQuality.prompt.addFilters', 'Adicione filtros úteis para o analista refinar os dados do painel.'),
|
|
15908
16087
|
icon: 'filter_alt',
|
|
15909
16088
|
changeKind: 'add_dashboard_filters',
|
|
15910
16089
|
contextHints,
|
|
@@ -15913,8 +16092,8 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15913
16092
|
if (warnings.includes('dashboard-without-chart-widget')) {
|
|
15914
16093
|
replies.push(this.dashboardQualityQuickReply({
|
|
15915
16094
|
id: 'dashboard-quality-add-chart',
|
|
15916
|
-
label: this.context.tx('agentic.dashboardQuality.quickReply.addChart', '
|
|
15917
|
-
prompt: this.context.tx('agentic.dashboardQuality.prompt.addChart', '
|
|
16095
|
+
label: this.context.tx('agentic.dashboardQuality.quickReply.addChart', 'Adicionar gráfico'),
|
|
16096
|
+
prompt: this.context.tx('agentic.dashboardQuality.prompt.addChart', 'Adicione o gráfico mais útil para explicar os dados desse painel e conecte-o aos detalhes quando possível.'),
|
|
15918
16097
|
icon: 'insert_chart',
|
|
15919
16098
|
changeKind: 'add_dashboard_chart',
|
|
15920
16099
|
contextHints,
|
|
@@ -15923,8 +16102,8 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15923
16102
|
if (warnings.includes('dashboard-without-record-detail-widget')) {
|
|
15924
16103
|
replies.push(this.dashboardQualityQuickReply({
|
|
15925
16104
|
id: 'dashboard-quality-add-details',
|
|
15926
|
-
label: this.context.tx('agentic.dashboardQuality.quickReply.addDetails', '
|
|
15927
|
-
prompt: this.context.tx('agentic.dashboardQuality.prompt.addDetails', '
|
|
16105
|
+
label: this.context.tx('agentic.dashboardQuality.quickReply.addDetails', 'Adicionar detalhes'),
|
|
16106
|
+
prompt: this.context.tx('agentic.dashboardQuality.prompt.addDetails', 'Inclua uma área de detalhes para o analista consultar os registros por trás dos indicadores.'),
|
|
15928
16107
|
icon: 'view_list',
|
|
15929
16108
|
changeKind: 'add_dashboard_detail_widget',
|
|
15930
16109
|
contextHints,
|
|
@@ -15935,8 +16114,8 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15935
16114
|
|| warnings.includes('dashboard-chart-not-interactive')) {
|
|
15936
16115
|
replies.push(this.dashboardQualityQuickReply({
|
|
15937
16116
|
id: 'dashboard-quality-connect-widgets',
|
|
15938
|
-
label: this.context.tx('agentic.dashboardQuality.quickReply.connectWidgets', '
|
|
15939
|
-
prompt: this.context.tx('agentic.dashboardQuality.prompt.connectWidgets', '
|
|
16117
|
+
label: this.context.tx('agentic.dashboardQuality.quickReply.connectWidgets', 'Conectar painel e detalhes'),
|
|
16118
|
+
prompt: this.context.tx('agentic.dashboardQuality.prompt.connectWidgets', 'Faça filtros e escolhas no gráfico atualizarem a área de detalhes do painel.'),
|
|
15940
16119
|
icon: 'hub',
|
|
15941
16120
|
changeKind: 'connect_dashboard_widgets',
|
|
15942
16121
|
contextHints,
|
|
@@ -15945,8 +16124,8 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
15945
16124
|
if (warnings.includes('dashboard-without-surface-actions')) {
|
|
15946
16125
|
replies.push(this.dashboardQualityQuickReply({
|
|
15947
16126
|
id: 'dashboard-quality-add-surfaces',
|
|
15948
|
-
label: this.context.tx('agentic.dashboardQuality.quickReply.addSurfaces', '
|
|
15949
|
-
prompt: this.context.tx('agentic.dashboardQuality.prompt.addSurfaces', '
|
|
16127
|
+
label: this.context.tx('agentic.dashboardQuality.quickReply.addSurfaces', 'Abrir detalhes relacionados'),
|
|
16128
|
+
prompt: this.context.tx('agentic.dashboardQuality.prompt.addSurfaces', 'Permita abrir detalhes relacionados a partir das seleções do painel, sem expor termos técnicos ao usuário.'),
|
|
15950
16129
|
icon: 'open_in_new',
|
|
15951
16130
|
changeKind: 'add_dashboard_surfaces',
|
|
15952
16131
|
contextHints,
|
|
@@ -16068,45 +16247,45 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
16068
16247
|
let status = null;
|
|
16069
16248
|
switch (phase) {
|
|
16070
16249
|
case 'context.bundle':
|
|
16071
|
-
status = this.context.tx('agentic.status.contextBundle', '
|
|
16250
|
+
status = this.context.tx('agentic.status.contextBundle', 'Organizando informações...');
|
|
16072
16251
|
break;
|
|
16073
16252
|
case 'intent.resolve':
|
|
16074
16253
|
if (this.isSecondPassStreamPayload(payload)) {
|
|
16075
|
-
status = this.context.tx('agentic.status.refinedCandidates', '
|
|
16254
|
+
status = this.context.tx('agentic.status.refinedCandidates', 'Conferindo as fontes encontradas...');
|
|
16076
16255
|
break;
|
|
16077
16256
|
}
|
|
16078
|
-
status = this.context.tx('agentic.status.resolvingIntent', '
|
|
16257
|
+
status = this.context.tx('agentic.status.resolvingIntent', 'Entendendo o pedido...');
|
|
16079
16258
|
break;
|
|
16080
16259
|
case 'resource.discovery':
|
|
16081
16260
|
if (this.isBackendResourceDiscoveryPayload(payload)) {
|
|
16082
|
-
status = this.context.tx('agentic.status.resourceDiscoveryBackend', '
|
|
16261
|
+
status = this.context.tx('agentic.status.resourceDiscoveryBackend', 'Encontrei fontes de dados no catálogo do domínio.');
|
|
16083
16262
|
break;
|
|
16084
16263
|
}
|
|
16085
|
-
status = this.context.tx('agentic.status.resourceDiscovery', '
|
|
16264
|
+
status = this.context.tx('agentic.status.resourceDiscovery', 'Buscando fontes de dados...');
|
|
16086
16265
|
break;
|
|
16087
16266
|
case 'projectKnowledge.retrieve':
|
|
16088
16267
|
status = this.projectKnowledgeStatusForStreamPayload(payload);
|
|
16089
16268
|
break;
|
|
16090
16269
|
case 'preview.plan':
|
|
16091
|
-
status = this.context.tx('agentic.status.previewing', '
|
|
16270
|
+
status = this.context.tx('agentic.status.previewing', 'Criando prévia...');
|
|
16092
16271
|
break;
|
|
16093
16272
|
case 'preview.compile':
|
|
16094
|
-
status = this.context.tx('agentic.status.previewCompile', '
|
|
16273
|
+
status = this.context.tx('agentic.status.previewCompile', 'Montando a tela...');
|
|
16095
16274
|
break;
|
|
16096
16275
|
case 'stream.waiting':
|
|
16097
|
-
status = this.context.tx('agentic.status.streamWaiting', '
|
|
16276
|
+
status = this.context.tx('agentic.status.streamWaiting', 'Ainda estou montando este painel. Mantendo o pedido em andamento...');
|
|
16098
16277
|
break;
|
|
16099
16278
|
case 'stream.start.accepted':
|
|
16100
|
-
status = this.context.tx('agentic.status.streamStartAccepted', '
|
|
16279
|
+
status = this.context.tx('agentic.status.streamStartAccepted', 'Pedido recebido. Abrindo o acompanhamento da criação...');
|
|
16101
16280
|
break;
|
|
16102
16281
|
case 'stream.probe.ready':
|
|
16103
|
-
status = this.context.tx('agentic.status.streamProbeReady', '
|
|
16282
|
+
status = this.context.tx('agentic.status.streamProbeReady', 'Acompanhamento da criação disponível.');
|
|
16104
16283
|
break;
|
|
16105
16284
|
case 'stream.transport.opening':
|
|
16106
|
-
status = this.context.tx('agentic.status.streamTransportOpening', '
|
|
16285
|
+
status = this.context.tx('agentic.status.streamTransportOpening', 'Abrindo acompanhamento em tempo real...');
|
|
16107
16286
|
break;
|
|
16108
16287
|
case 'stream.first-event.received':
|
|
16109
|
-
status = this.context.tx('agentic.status.streamFirstEventReceived', '
|
|
16288
|
+
status = this.context.tx('agentic.status.streamFirstEventReceived', 'Criação iniciada.');
|
|
16110
16289
|
break;
|
|
16111
16290
|
default:
|
|
16112
16291
|
status = this.readString(payload, 'summary') || this.readString(payload, 'message');
|
|
@@ -16123,17 +16302,17 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
16123
16302
|
return status;
|
|
16124
16303
|
}
|
|
16125
16304
|
return this.context
|
|
16126
|
-
.tx('agentic.status.backendProgressElapsed', '{status}
|
|
16305
|
+
.tx('agentic.status.backendProgressElapsed', '{status} Ainda trabalhando nisso há {seconds}s.')
|
|
16127
16306
|
.replace('{status}', status)
|
|
16128
16307
|
.replace('{seconds}', `${Math.round(elapsedSeconds)}`);
|
|
16129
16308
|
}
|
|
16130
16309
|
projectKnowledgeStatusForStreamPayload(payload) {
|
|
16131
16310
|
const diagnostics = this.toJsonObject(payload['diagnostics']);
|
|
16132
16311
|
const influenceCount = this.readNumber(diagnostics ?? {}, 'influenceCount');
|
|
16133
|
-
const base = this.context.tx('agentic.status.projectKnowledgeRetrieved', '
|
|
16312
|
+
const base = this.context.tx('agentic.status.projectKnowledgeRetrieved', 'Encontrei conhecimento governado do projeto para orientar este pedido.');
|
|
16134
16313
|
if (influenceCount && influenceCount > 0) {
|
|
16135
16314
|
return this.context
|
|
16136
|
-
.tx('agentic.status.projectKnowledgeRetrievedCount', '
|
|
16315
|
+
.tx('agentic.status.projectKnowledgeRetrievedCount', 'Encontrei {count} sinais governados do projeto para orientar este pedido.')
|
|
16137
16316
|
.replace('{count}', String(influenceCount));
|
|
16138
16317
|
}
|
|
16139
16318
|
return base;
|
|
@@ -16144,8 +16323,8 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
16144
16323
|
return normalized;
|
|
16145
16324
|
}
|
|
16146
16325
|
return canApply
|
|
16147
|
-
? this.context.tx('agentic.status.reviewReady', '
|
|
16148
|
-
: this.context.tx('agentic.status.reviewNeedsAttention', '
|
|
16326
|
+
? this.context.tx('agentic.status.reviewReady', 'Pronto para revisão.')
|
|
16327
|
+
: this.context.tx('agentic.status.reviewNeedsAttention', 'Revise os pontos pendentes antes de salvar.');
|
|
16149
16328
|
}
|
|
16150
16329
|
shouldReplaceReviewStatus(status) {
|
|
16151
16330
|
const normalized = status.toLocaleLowerCase();
|
|
@@ -16166,13 +16345,13 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
16166
16345
|
describeStreamError(payload) {
|
|
16167
16346
|
const code = this.readString(payload, 'code');
|
|
16168
16347
|
if (code === 'agentic-authoring-timeout') {
|
|
16169
|
-
return this.context.tx('agentic.errors.streamTimeout', '
|
|
16348
|
+
return this.context.tx('agentic.errors.streamTimeout', 'O assistente demorou para concluir este pedido. Tente de novo com um recorte menor ou revise o contexto ativo.');
|
|
16170
16349
|
}
|
|
16171
16350
|
if (code === 'agentic-authoring-processing-failed') {
|
|
16172
|
-
return this.context.tx('agentic.errors.streamProcessing', '
|
|
16351
|
+
return this.context.tx('agentic.errors.streamProcessing', 'Não consegui concluir este pedido. Tente novamente ou peça uma revisão dos detalhes.');
|
|
16173
16352
|
}
|
|
16174
16353
|
return this.readString(payload, 'assistantMessage')
|
|
16175
|
-
|| this.context.tx('agentic.errors.generic', '
|
|
16354
|
+
|| this.context.tx('agentic.errors.generic', 'Não consegui concluir este pedido.');
|
|
16176
16355
|
}
|
|
16177
16356
|
toTurnStreamTransportErrorResult(error) {
|
|
16178
16357
|
const message = this.isTurnStreamConnectionError(error)
|
|
@@ -16249,7 +16428,7 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
16249
16428
|
toGovernedRouteFailClosedResult(request, prompt, error) {
|
|
16250
16429
|
const contextHints = this.buildContextHints(request);
|
|
16251
16430
|
const domainCatalog = this.toJsonObject(contextHints?.['domainCatalog']);
|
|
16252
|
-
const assistantMessage = this.context.tx('agentic.governedRoute.streamUnavailable', '
|
|
16431
|
+
const assistantMessage = this.context.tx('agentic.governedRoute.streamUnavailable', 'Este pedido precisa continuar pela revisão governada da regra de negócio. Não vou criar uma prévia local enquanto essa revisão não estiver disponível.');
|
|
16253
16432
|
const intentResolution = {
|
|
16254
16433
|
valid: false,
|
|
16255
16434
|
operationKind: 'route',
|
|
@@ -16463,9 +16642,9 @@ class PageBuilderAgenticAuthoringTurnFlow {
|
|
|
16463
16642
|
return backendText;
|
|
16464
16643
|
}
|
|
16465
16644
|
const firstLabel = quickReplies[0]?.label?.trim()
|
|
16466
|
-
|| this.context.tx('agentic.resourceDiscovery.defaultRecommendedLabel', '
|
|
16645
|
+
|| this.context.tx('agentic.resourceDiscovery.defaultRecommendedLabel', 'a primeira opção');
|
|
16467
16646
|
const sourceCount = this.resourceDiscoverySourceCountLabel(quickReplies.length);
|
|
16468
|
-
return this.context.tx('agentic.resourceDiscovery.found', '
|
|
16647
|
+
return this.context.tx('agentic.resourceDiscovery.found', 'Encontrei {sourceCount} para esta tela. Recomendo começar por {first}, porque parece a melhor opção para indicadores, gráficos e detalhes. Revise as opções abaixo e escolha a fonte que melhor combina com o que você quer criar.')
|
|
16469
16648
|
.replace('{sourceCount}', sourceCount)
|
|
16470
16649
|
.replace('{first}', firstLabel);
|
|
16471
16650
|
}
|
|
@@ -17554,13 +17733,13 @@ function deriveSharedRuleContinuationActions(input) {
|
|
|
17554
17733
|
return status === 'applied' || status === 'active';
|
|
17555
17734
|
});
|
|
17556
17735
|
return [
|
|
17557
|
-
sharedRuleAction('open_definition', '
|
|
17558
|
-
sharedRuleAction('simulate', '
|
|
17559
|
-
sharedRuleAction('approve', '
|
|
17560
|
-
sharedRuleAction('publish', '
|
|
17561
|
-
sharedRuleAction('materialize', '
|
|
17562
|
-
sharedRuleAction('validate_enforcement', '
|
|
17563
|
-
sharedRuleAction('open_timeline', '
|
|
17736
|
+
sharedRuleAction('open_definition', 'Preparar regra', 'Preparar ou abrir a regra governada para revisão.', target, enabledWhen(!busy && hasAuthoringTarget && !definitionId, busy ? 'busy' : definitionId ? 'definition_already_available' : !handoff ? 'missing_handoff' : 'missing_authoring_target')),
|
|
17737
|
+
sharedRuleAction('simulate', 'Simular impacto', 'Verificar o efeito da regra antes de publicar.', target, enabledWhen(!busy && !!definitionId, busy ? 'busy' : 'missing_definition')),
|
|
17738
|
+
sharedRuleAction('approve', 'Aprovar revisão', 'Aprovar a regra governada depois da conferência.', target, enabledWhen(!busy && !!definitionId && definitionStatus !== 'approved' && definitionStatus !== 'active', busy ? 'busy' : !definitionId ? 'missing_definition' : 'definition_already_available')),
|
|
17739
|
+
sharedRuleAction('publish', 'Publicar alteração', 'Publicar a decisão aprovada e atualizar as telas que dependem dela.', target, enabledWhen(!busy && !!definitionId, busy ? 'busy' : 'missing_definition')),
|
|
17740
|
+
sharedRuleAction('materialize', 'Ver telas afetadas', 'Ver quais telas serão atualizadas por essa decisão governada.', target, enabledWhen(!busy && !!definitionId, busy ? 'busy' : 'missing_definition')),
|
|
17741
|
+
sharedRuleAction('validate_enforcement', 'Validar aplicação', 'Conferir se a alteração publicada já está pronta para uso.', target, enabledWhen(!busy && !!definitionId && hasAppliedMaterialization, busy ? 'busy' : !definitionId ? 'missing_definition' : 'missing_materialization')),
|
|
17742
|
+
sharedRuleAction('open_timeline', 'Ver histórico', 'Abrir o histórico seguro dessa decisão governada.', target, enabledWhen(!busy && !!definitionId && hasTimelineEvents, busy ? 'busy' : !definitionId ? 'missing_definition' : 'timeline_unavailable')),
|
|
17564
17743
|
];
|
|
17565
17744
|
}
|
|
17566
17745
|
function deriveProjectKnowledgeContinuationActions(input) {
|
|
@@ -17575,12 +17754,12 @@ function deriveProjectKnowledgeContinuationActions(input) {
|
|
|
17575
17754
|
const hasTimelineEvents = (input.timeline?.events?.length ?? 0) > 0;
|
|
17576
17755
|
const target = projectKnowledgeTarget(changeSet, candidate?.conceptKey ?? null);
|
|
17577
17756
|
return [
|
|
17578
|
-
projectKnowledgeAction('create_knowledge_change_set', '
|
|
17579
|
-
projectKnowledgeAction('validate_knowledge_change_set', '
|
|
17580
|
-
projectKnowledgeAction('approve', '
|
|
17581
|
-
projectKnowledgeAction('reject', '
|
|
17582
|
-
projectKnowledgeAction('apply_knowledge_change_set', '
|
|
17583
|
-
projectKnowledgeAction('open_timeline', '
|
|
17757
|
+
projectKnowledgeAction('create_knowledge_change_set', 'Preparar revisão', 'Preparar uma proposta governada a partir do conhecimento citado.', target, enabledWhen(!busy && !!audit && !!candidate && !changeSet, busy ? 'busy' : !audit ? 'missing_project_knowledge_audit' : !candidate ? 'missing_project_knowledge_candidate' : 'change_set_already_available')),
|
|
17758
|
+
projectKnowledgeAction('validate_knowledge_change_set', 'Validar proposta', 'Conferir a proposta antes da revisão.', target, enabledWhen(!busy && !!changeSet && validationStatus !== 'valid', busy ? 'busy' : !changeSet ? 'missing_change_set' : 'validation_already_valid')),
|
|
17759
|
+
projectKnowledgeAction('approve', 'Aprovar revisão', 'Aprovar explicitamente a proposta validada.', target, enabledWhen(!busy && !!changeSet && validationValid && status !== 'approved' && status !== 'applied', busy ? 'busy' : !changeSet ? 'missing_change_set' : 'validation_required')),
|
|
17760
|
+
projectKnowledgeAction('reject', 'Rejeitar proposta', 'Rejeitar a proposta sem aplicar mudanças no conhecimento.', target, enabledWhen(!busy && !!changeSet && status !== 'applied', busy ? 'busy' : !changeSet ? 'missing_change_set' : 'already_applied')),
|
|
17761
|
+
projectKnowledgeAction('apply_knowledge_change_set', 'Aplicar conhecimento', 'Aplicar somente depois da aprovação e da validação.', target, enabledWhen(!busy && !!changeSet && validationValid && status === 'approved', busy ? 'busy' : !changeSet ? 'missing_change_set' : !validationValid ? 'validation_required' : status === 'applied' ? 'already_applied' : 'approval_required')),
|
|
17762
|
+
projectKnowledgeAction('open_timeline', 'Ver histórico', 'Abrir o histórico seguro dessa revisão de conhecimento.', target, enabledWhen(!busy && !!changeSet && hasTimelineEvents, busy ? 'busy' : !changeSet ? 'missing_change_set' : 'timeline_unavailable')),
|
|
17584
17763
|
];
|
|
17585
17764
|
}
|
|
17586
17765
|
function selectProjectKnowledgeContinuationCandidate(audit) {
|
|
@@ -17634,6 +17813,7 @@ function projectKnowledgeTarget(changeSet, conceptKey) {
|
|
|
17634
17813
|
};
|
|
17635
17814
|
}
|
|
17636
17815
|
|
|
17816
|
+
const AGENTIC_AUTHORING_TURN_TERMINAL_TIMEOUT_MS = 120_000;
|
|
17637
17817
|
const AGENTIC_PAGE_COMPOSITION_REQUEST_OUTPUT = 'agenticPageCompositionRequested';
|
|
17638
17818
|
class DynamicPageBuilderComponent {
|
|
17639
17819
|
dialog;
|
|
@@ -17644,6 +17824,7 @@ class DynamicPageBuilderComponent {
|
|
|
17644
17824
|
agenticAuthoring = inject(PageBuilderAgenticAuthoringService);
|
|
17645
17825
|
agenticTurnOrchestrator = inject(PraxisAssistantTurnOrchestratorService);
|
|
17646
17826
|
assistantSessions = inject(PraxisAssistantSessionRegistryService);
|
|
17827
|
+
runtimeObservationRegistry = inject(PraxisRuntimeComponentObservationRegistryService, { optional: true });
|
|
17647
17828
|
agenticAuthoringOptions = inject(PAGE_BUILDER_AGENTIC_AUTHORING_OPTIONS, { optional: true });
|
|
17648
17829
|
runtime;
|
|
17649
17830
|
page;
|
|
@@ -17722,6 +17903,9 @@ class DynamicPageBuilderComponent {
|
|
|
17722
17903
|
agenticComponentCapabilities;
|
|
17723
17904
|
agenticComponentCapabilitiesPromise;
|
|
17724
17905
|
agenticTurnController;
|
|
17906
|
+
agenticTurnCancel$ = new Subject();
|
|
17907
|
+
agenticTurnRunId = 0;
|
|
17908
|
+
agenticAuthoringTurnTerminalTimeoutMs = AGENTIC_AUTHORING_TURN_TERMINAL_TIMEOUT_MS;
|
|
17725
17909
|
sharedRuleHandoffRevision = 0;
|
|
17726
17910
|
agenticAuthoringPanelLayoutTouched = false;
|
|
17727
17911
|
constructor(dialog, settingsPanel) {
|
|
@@ -17743,6 +17927,10 @@ class DynamicPageBuilderComponent {
|
|
|
17743
17927
|
this.resetAgenticAuthoringSessionState();
|
|
17744
17928
|
}
|
|
17745
17929
|
}
|
|
17930
|
+
ngOnDestroy() {
|
|
17931
|
+
this.cancelActiveAgenticTurn();
|
|
17932
|
+
this.agenticTurnCancel$.complete();
|
|
17933
|
+
}
|
|
17746
17934
|
showSettings() {
|
|
17747
17935
|
return !!this.enableCustomization && !this.previewMode;
|
|
17748
17936
|
}
|
|
@@ -17956,24 +18144,24 @@ class DynamicPageBuilderComponent {
|
|
|
17956
18144
|
agenticAuthoringHeaderSubtitle() {
|
|
17957
18145
|
const selectedWidgetLabel = this.resolveSelectedWidgetLabel();
|
|
17958
18146
|
if (this.agenticAuthoringSharedRuleHandoffState()) {
|
|
17959
|
-
return this.tx('agentic.header.subtitle.governed', 'Continue
|
|
18147
|
+
return this.tx('agentic.header.subtitle.governed', 'Continue a revisão da regra antes de criar a tela.');
|
|
17960
18148
|
}
|
|
17961
18149
|
if (this.agenticAuthoringPreviewResult()?.valid) {
|
|
17962
18150
|
if (!this.agenticAuthoringCanApply()) {
|
|
17963
|
-
return this.tx('agentic.header.subtitle.reviewBlocked', '
|
|
18151
|
+
return this.tx('agentic.header.subtitle.reviewBlocked', 'Prévia pronta, com pontos para revisar.');
|
|
17964
18152
|
}
|
|
17965
|
-
return this.tx('agentic.header.subtitle.review', '
|
|
18153
|
+
return this.tx('agentic.header.subtitle.review', 'Prévia pronta para revisar e salvar.');
|
|
17966
18154
|
}
|
|
17967
18155
|
if (selectedWidgetLabel) {
|
|
17968
|
-
return this.tx('agentic.header.subtitle.widget', '
|
|
18156
|
+
return this.tx('agentic.header.subtitle.widget', 'Foco em {target}.')
|
|
17969
18157
|
.replace('{target}', selectedWidgetLabel);
|
|
17970
18158
|
}
|
|
17971
18159
|
const routePath = this.pageIdentity?.routePath?.trim();
|
|
17972
18160
|
if (routePath) {
|
|
17973
|
-
return this.tx('agentic.header.subtitle.route', '
|
|
18161
|
+
return this.tx('agentic.header.subtitle.route', 'Criando ou ajustando a página {route}.')
|
|
17974
18162
|
.replace('{route}', routePath);
|
|
17975
18163
|
}
|
|
17976
|
-
return this.tx('agentic.header.subtitle.page', '
|
|
18164
|
+
return this.tx('agentic.header.subtitle.page', 'Transforme uma necessidade do domínio em tabela, formulário ou painel.');
|
|
17977
18165
|
}
|
|
17978
18166
|
agenticAuthoringHeaderModeLabel() {
|
|
17979
18167
|
if (this.agenticAuthoringSharedRuleHandoffState()) {
|
|
@@ -17992,8 +18180,8 @@ class DynamicPageBuilderComponent {
|
|
|
17992
18180
|
prompt: this.tx('agentic.promptLabel', 'Message'),
|
|
17993
18181
|
promptPlaceholder: this.tx('agentic.promptPlaceholder', 'Describe the page, dashboard, form or change you need.'),
|
|
17994
18182
|
emptyConversation: this.agenticAuthoringEmptyConversationMessage(),
|
|
17995
|
-
submit: this.tx('agentic.preview', '
|
|
17996
|
-
apply: this.tx('agentic.persist', '
|
|
18183
|
+
submit: this.tx('agentic.preview', 'Criar prévia'),
|
|
18184
|
+
apply: this.tx('agentic.persist', 'Salvar'),
|
|
17997
18185
|
conversationAria: this.tx('agentic.conversationAria', 'AI conversation'),
|
|
17998
18186
|
quickRepliesAria: this.tx('agentic.quickRepliesAria', 'Quick replies'),
|
|
17999
18187
|
dragHandleAria: this.tx('agentic.dragHandleAria', 'Move AI assistant'),
|
|
@@ -18026,9 +18214,9 @@ class DynamicPageBuilderComponent {
|
|
|
18026
18214
|
return authoredOpening;
|
|
18027
18215
|
}
|
|
18028
18216
|
if (this.isAgenticAuthoringPageBlank()) {
|
|
18029
|
-
return this.tx('agentic.emptyConversation.blankGeneric', '
|
|
18217
|
+
return this.tx('agentic.emptyConversation.blankGeneric', 'Esta tela ainda está vazia. Diga qual atividade do domínio ela precisa apoiar. Posso sugerir um painel, tabela ou formulário e montar uma prévia para você revisar antes de salvar.');
|
|
18030
18218
|
}
|
|
18031
|
-
return this.tx('agentic.emptyConversation.existingPage', '
|
|
18219
|
+
return this.tx('agentic.emptyConversation.existingPage', 'Diga o que você quer melhorar nesta tela. Eu leio o que já existe e preparo uma prévia para você revisar antes de salvar.');
|
|
18032
18220
|
}
|
|
18033
18221
|
resolveAgenticAuthoredOpeningMessage() {
|
|
18034
18222
|
const hints = this.toRecord(this.agenticAuthoringContextHints);
|
|
@@ -18057,7 +18245,7 @@ class DynamicPageBuilderComponent {
|
|
|
18057
18245
|
return !!this.agenticAuthoringPreviewResult()?.valid && !this.agenticAuthoringCanApply();
|
|
18058
18246
|
}
|
|
18059
18247
|
agenticAuthoringSubmitAction() {
|
|
18060
|
-
const label = this.tx('agentic.preview', '
|
|
18248
|
+
const label = this.tx('agentic.preview', 'Criar prévia');
|
|
18061
18249
|
return {
|
|
18062
18250
|
id: 'submit',
|
|
18063
18251
|
kind: 'submit-prompt',
|
|
@@ -18108,12 +18296,12 @@ class DynamicPageBuilderComponent {
|
|
|
18108
18296
|
return this.truncateAgenticDockText(lastMessage.text);
|
|
18109
18297
|
}
|
|
18110
18298
|
if (this.agenticAuthoringPreviewResult()?.valid) {
|
|
18111
|
-
return this.tx('agentic.dock.summaryReview', '
|
|
18299
|
+
return this.tx('agentic.dock.summaryReview', 'Prévia pronta. Reabra para revisar ou salvar.');
|
|
18112
18300
|
}
|
|
18113
18301
|
if (this.agenticAuthoringSharedRuleHandoffState()) {
|
|
18114
|
-
return this.tx('agentic.dock.summaryGoverned', '
|
|
18302
|
+
return this.tx('agentic.dock.summaryGoverned', 'Revisão preservada. Continue de onde parou.');
|
|
18115
18303
|
}
|
|
18116
|
-
return this.tx('agentic.dock.summaryIdle', '
|
|
18304
|
+
return this.tx('agentic.dock.summaryIdle', 'Conversa preservada. Continue de onde parou.');
|
|
18117
18305
|
}
|
|
18118
18306
|
agenticAuthoringShellState() {
|
|
18119
18307
|
if (this.agenticAuthoringBusy())
|
|
@@ -18621,6 +18809,7 @@ class DynamicPageBuilderComponent {
|
|
|
18621
18809
|
const prompt = this.agenticAuthoringPrompt().trim();
|
|
18622
18810
|
if (!prompt || this.agenticAuthoringBusy())
|
|
18623
18811
|
return;
|
|
18812
|
+
const turnRunId = this.beginAgenticTurn();
|
|
18624
18813
|
this.agenticAuthoringBusy.set(true);
|
|
18625
18814
|
this.agenticAuthoringError.set('');
|
|
18626
18815
|
this.agenticAuthoringPreviewResult.set(null);
|
|
@@ -18628,37 +18817,43 @@ class DynamicPageBuilderComponent {
|
|
|
18628
18817
|
this.agenticAuthoringSharedRuleHandoffState.set(null);
|
|
18629
18818
|
this.clearSharedRuleCockpitState();
|
|
18630
18819
|
this.clearProjectKnowledgeCockpitState();
|
|
18631
|
-
this.agenticAuthoringStatus.set(this.tx('agentic.status.resolvingIntent', '
|
|
18820
|
+
this.agenticAuthoringStatus.set(this.tx('agentic.status.resolvingIntent', 'Entendendo o pedido...'));
|
|
18632
18821
|
try {
|
|
18633
18822
|
const controller = this.ensureAgenticTurnController();
|
|
18634
18823
|
const editingMessageId = this.agenticAuthoringEditingMessageId();
|
|
18635
18824
|
await this.consumeAgenticTurn(editingMessageId
|
|
18636
18825
|
? controller.submitEditedMessage(editingMessageId, prompt)
|
|
18637
|
-
: controller.submitPrompt(prompt));
|
|
18826
|
+
: controller.submitPrompt(prompt), turnRunId);
|
|
18638
18827
|
this.agenticAuthoringEditingMessageId.set(null);
|
|
18639
18828
|
this.agenticAuthoringPrompt.set('');
|
|
18640
18829
|
}
|
|
18641
18830
|
catch (error) {
|
|
18831
|
+
if (!this.isCurrentAgenticTurn(turnRunId))
|
|
18832
|
+
return;
|
|
18642
18833
|
this.agenticAuthoringStatus.set('');
|
|
18643
18834
|
const message = this.describeAgenticError(error);
|
|
18644
18835
|
this.agenticAuthoringError.set(message);
|
|
18645
18836
|
this.appendAgenticMessage('error', message);
|
|
18646
18837
|
}
|
|
18647
18838
|
finally {
|
|
18648
|
-
this.
|
|
18839
|
+
if (this.isCurrentAgenticTurn(turnRunId)) {
|
|
18840
|
+
this.agenticAuthoringBusy.set(false);
|
|
18841
|
+
}
|
|
18649
18842
|
}
|
|
18650
18843
|
}
|
|
18651
18844
|
async submitAgenticQuickReply(reply) {
|
|
18652
18845
|
const replyKind = (reply.kind || 'suggestion').trim().toLowerCase();
|
|
18653
18846
|
if (replyKind === 'cancel') {
|
|
18847
|
+
this.cancelActiveAgenticTurn();
|
|
18848
|
+
this.agenticAuthoringBusy.set(false);
|
|
18654
18849
|
this.agenticAuthoringEditingMessageId.set(null);
|
|
18655
|
-
await this.
|
|
18850
|
+
await this.applyAgenticTurnState(await firstValueFrom(this.ensureAgenticTurnController().cancel()));
|
|
18656
18851
|
return;
|
|
18657
18852
|
}
|
|
18658
18853
|
if (replyKind === 'revise') {
|
|
18659
18854
|
this.agenticAuthoringEditingMessageId.set(null);
|
|
18660
18855
|
this.agenticAuthoringQuickReplies.set([]);
|
|
18661
|
-
this.agenticAuthoringStatus.set(this.tx('agentic.status.waitingRevision', '
|
|
18856
|
+
this.agenticAuthoringStatus.set(this.tx('agentic.status.waitingRevision', 'Ajuste o pedido e crie uma nova prévia.'));
|
|
18662
18857
|
return;
|
|
18663
18858
|
}
|
|
18664
18859
|
this.agenticAuthoringEditingMessageId.set(null);
|
|
@@ -18669,6 +18864,7 @@ class DynamicPageBuilderComponent {
|
|
|
18669
18864
|
return;
|
|
18670
18865
|
}
|
|
18671
18866
|
this.agenticAuthoringPrompt.set(visiblePrompt);
|
|
18867
|
+
const turnRunId = this.beginAgenticTurn();
|
|
18672
18868
|
this.agenticAuthoringQuickReplies.set([]);
|
|
18673
18869
|
this.agenticAuthoringBusy.set(true);
|
|
18674
18870
|
this.agenticAuthoringError.set('');
|
|
@@ -18677,7 +18873,7 @@ class DynamicPageBuilderComponent {
|
|
|
18677
18873
|
this.agenticAuthoringSharedRuleHandoffState.set(null);
|
|
18678
18874
|
this.clearSharedRuleCockpitState();
|
|
18679
18875
|
this.clearProjectKnowledgeCockpitState();
|
|
18680
|
-
this.agenticAuthoringStatus.set(this.tx('agentic.status.resolvingIntent', '
|
|
18876
|
+
this.agenticAuthoringStatus.set(this.tx('agentic.status.resolvingIntent', 'Entendendo o pedido...'));
|
|
18681
18877
|
try {
|
|
18682
18878
|
const controller = this.ensureAgenticTurnController();
|
|
18683
18879
|
const actionKind = controller.snapshot().state === 'clarification'
|
|
@@ -18690,17 +18886,21 @@ class DynamicPageBuilderComponent {
|
|
|
18690
18886
|
value: reply.prompt,
|
|
18691
18887
|
displayPrompt: visiblePrompt,
|
|
18692
18888
|
contextHints,
|
|
18693
|
-
}));
|
|
18889
|
+
}), turnRunId);
|
|
18694
18890
|
this.agenticAuthoringPrompt.set('');
|
|
18695
18891
|
}
|
|
18696
18892
|
catch (error) {
|
|
18893
|
+
if (!this.isCurrentAgenticTurn(turnRunId))
|
|
18894
|
+
return;
|
|
18697
18895
|
this.agenticAuthoringStatus.set('');
|
|
18698
18896
|
const message = this.describeAgenticError(error);
|
|
18699
18897
|
this.agenticAuthoringError.set(message);
|
|
18700
18898
|
this.appendAgenticMessage('error', message);
|
|
18701
18899
|
}
|
|
18702
18900
|
finally {
|
|
18703
|
-
this.
|
|
18901
|
+
if (this.isCurrentAgenticTurn(turnRunId)) {
|
|
18902
|
+
this.agenticAuthoringBusy.set(false);
|
|
18903
|
+
}
|
|
18704
18904
|
}
|
|
18705
18905
|
}
|
|
18706
18906
|
agenticQuickReplyVisiblePrompt(reply, contextHints) {
|
|
@@ -18894,54 +19094,64 @@ class DynamicPageBuilderComponent {
|
|
|
18894
19094
|
return;
|
|
18895
19095
|
this.agenticAuthoringEditingMessageId.set(message.id);
|
|
18896
19096
|
this.agenticAuthoringPrompt.set(message.text);
|
|
18897
|
-
this.agenticAuthoringStatus.set(this.tx('agentic.status.waitingRevision', '
|
|
19097
|
+
this.agenticAuthoringStatus.set(this.tx('agentic.status.waitingRevision', 'Ajuste o pedido e crie uma nova prévia.'));
|
|
18898
19098
|
}
|
|
18899
19099
|
async resendAgenticMessage(message) {
|
|
18900
19100
|
if (message.role !== 'user' || this.agenticAuthoringBusy())
|
|
18901
19101
|
return;
|
|
19102
|
+
const turnRunId = this.beginAgenticTurn();
|
|
18902
19103
|
this.agenticAuthoringEditingMessageId.set(null);
|
|
18903
19104
|
this.agenticAuthoringBusy.set(true);
|
|
18904
|
-
this.agenticAuthoringStatus.set(this.tx('agentic.status.resolvingIntent', '
|
|
19105
|
+
this.agenticAuthoringStatus.set(this.tx('agentic.status.resolvingIntent', 'Entendendo o pedido...'));
|
|
18905
19106
|
this.agenticAuthoringError.set('');
|
|
18906
19107
|
this.agenticAuthoringPreviewResult.set(null);
|
|
18907
19108
|
this.agenticAuthoringCanApply.set(false);
|
|
18908
19109
|
this.clearProjectKnowledgeCockpitState();
|
|
18909
19110
|
try {
|
|
18910
|
-
await this.consumeAgenticTurn(this.ensureAgenticTurnController().resendMessage(message.id));
|
|
19111
|
+
await this.consumeAgenticTurn(this.ensureAgenticTurnController().resendMessage(message.id), turnRunId);
|
|
18911
19112
|
}
|
|
18912
19113
|
catch (error) {
|
|
19114
|
+
if (!this.isCurrentAgenticTurn(turnRunId))
|
|
19115
|
+
return;
|
|
18913
19116
|
this.agenticAuthoringStatus.set('');
|
|
18914
19117
|
const errorMessage = this.describeAgenticError(error);
|
|
18915
19118
|
this.agenticAuthoringError.set(errorMessage);
|
|
18916
19119
|
this.appendAgenticMessage('error', errorMessage);
|
|
18917
19120
|
}
|
|
18918
19121
|
finally {
|
|
18919
|
-
this.
|
|
19122
|
+
if (this.isCurrentAgenticTurn(turnRunId)) {
|
|
19123
|
+
this.agenticAuthoringBusy.set(false);
|
|
19124
|
+
}
|
|
18920
19125
|
}
|
|
18921
19126
|
}
|
|
18922
19127
|
async retryAgenticAuthoring() {
|
|
18923
19128
|
if (this.agenticAuthoringBusy())
|
|
18924
19129
|
return;
|
|
19130
|
+
const turnRunId = this.beginAgenticTurn();
|
|
18925
19131
|
this.agenticAuthoringEditingMessageId.set(null);
|
|
18926
19132
|
this.agenticAuthoringBusy.set(true);
|
|
18927
|
-
this.agenticAuthoringStatus.set(this.tx('agentic.status.resolvingIntent', '
|
|
19133
|
+
this.agenticAuthoringStatus.set(this.tx('agentic.status.resolvingIntent', 'Entendendo o pedido...'));
|
|
18928
19134
|
this.agenticAuthoringError.set('');
|
|
18929
19135
|
try {
|
|
18930
|
-
await this.consumeAgenticTurn(this.ensureAgenticTurnController().retry());
|
|
19136
|
+
await this.consumeAgenticTurn(this.ensureAgenticTurnController().retry(), turnRunId);
|
|
18931
19137
|
}
|
|
18932
19138
|
catch (error) {
|
|
19139
|
+
if (!this.isCurrentAgenticTurn(turnRunId))
|
|
19140
|
+
return;
|
|
18933
19141
|
this.agenticAuthoringStatus.set('');
|
|
18934
19142
|
const errorMessage = this.describeAgenticError(error);
|
|
18935
19143
|
this.agenticAuthoringError.set(errorMessage);
|
|
18936
19144
|
this.appendAgenticMessage('error', errorMessage);
|
|
18937
19145
|
}
|
|
18938
19146
|
finally {
|
|
18939
|
-
this.
|
|
19147
|
+
if (this.isCurrentAgenticTurn(turnRunId)) {
|
|
19148
|
+
this.agenticAuthoringBusy.set(false);
|
|
19149
|
+
}
|
|
18940
19150
|
}
|
|
18941
19151
|
}
|
|
18942
19152
|
async cancelAgenticAuthoring() {
|
|
18943
|
-
|
|
18944
|
-
|
|
19153
|
+
this.cancelActiveAgenticTurn();
|
|
19154
|
+
this.agenticAuthoringBusy.set(false);
|
|
18945
19155
|
this.agenticAuthoringEditingMessageId.set(null);
|
|
18946
19156
|
this.agenticAuthoringPrompt.set('');
|
|
18947
19157
|
this.agenticAuthoringPreviewResult.set(null);
|
|
@@ -18950,7 +19160,7 @@ class DynamicPageBuilderComponent {
|
|
|
18950
19160
|
this.agenticAuthoringSharedRuleHandoffState.set(null);
|
|
18951
19161
|
this.clearSharedRuleCockpitState();
|
|
18952
19162
|
this.clearProjectKnowledgeCockpitState();
|
|
18953
|
-
await this.
|
|
19163
|
+
await this.applyAgenticTurnState(await firstValueFrom(this.ensureAgenticTurnController().cancel()));
|
|
18954
19164
|
}
|
|
18955
19165
|
async persistAgenticAuthoring() {
|
|
18956
19166
|
const preview = this.agenticAuthoringPreviewResult();
|
|
@@ -18963,7 +19173,7 @@ class DynamicPageBuilderComponent {
|
|
|
18963
19173
|
}
|
|
18964
19174
|
this.agenticAuthoringBusy.set(true);
|
|
18965
19175
|
this.agenticAuthoringError.set('');
|
|
18966
|
-
this.agenticAuthoringStatus.set(this.tx('agentic.status.saving', '
|
|
19176
|
+
this.agenticAuthoringStatus.set(this.tx('agentic.status.saving', 'Salvando tela...'));
|
|
18967
19177
|
try {
|
|
18968
19178
|
const compiledFormPatch = this.resolvePreviewCompiledFormPatch(preview);
|
|
18969
19179
|
const result = await firstValueFrom(this.agenticAuthoring.applyPage({
|
|
@@ -18983,7 +19193,7 @@ class DynamicPageBuilderComponent {
|
|
|
18983
19193
|
this.agenticAuthoringCanApply.set(false);
|
|
18984
19194
|
this.agenticAuthoringQuickReplies.set([]);
|
|
18985
19195
|
this.agenticAuthoringPrompt.set('');
|
|
18986
|
-
this.agenticAuthoringStatus.set(this.tx('agentic.status.saved', '
|
|
19196
|
+
this.agenticAuthoringStatus.set(this.tx('agentic.status.saved', 'Tela salva.'));
|
|
18987
19197
|
this.syncAgenticAuthoringSession();
|
|
18988
19198
|
}
|
|
18989
19199
|
catch (error) {
|
|
@@ -19543,14 +19753,14 @@ class DynamicPageBuilderComponent {
|
|
|
19543
19753
|
next.ruleKey = current.ruleKey || this.resolveSharedRuleKey(next, false);
|
|
19544
19754
|
this.agenticAuthoringPrompt.set(visiblePrompt);
|
|
19545
19755
|
this.agenticAuthoringQuickReplies.set([]);
|
|
19546
|
-
this.agenticAuthoringStatus.set(this.tx('agentic.status.sharedRuleTargetSelected', '
|
|
19756
|
+
this.agenticAuthoringStatus.set(this.tx('agentic.status.sharedRuleTargetSelected', 'Continue this request in the rule review.'));
|
|
19547
19757
|
this.agenticAuthoringError.set('');
|
|
19548
19758
|
this.agenticAuthoringPreviewResult.set(null);
|
|
19549
19759
|
this.agenticAuthoringCanApply.set(false);
|
|
19550
19760
|
this.agenticAuthoringSharedRuleHandoffState.set(next);
|
|
19551
19761
|
this.agenticAuthoringSharedRuleHandoff.emit(next);
|
|
19552
19762
|
this.appendAgenticMessage('user', visiblePrompt);
|
|
19553
|
-
this.appendAgenticMessage('assistant', this.tx('agentic.sharedRuleCockpit.targetSelected', '
|
|
19763
|
+
this.appendAgenticMessage('assistant', this.tx('agentic.sharedRuleCockpit.targetSelected', 'Rule identified. The next safe step is reviewing the rule before creating the screen.'));
|
|
19554
19764
|
return true;
|
|
19555
19765
|
}
|
|
19556
19766
|
resolveSharedRuleQuickReplyRuleType(contextHints, text) {
|
|
@@ -19763,6 +19973,12 @@ class DynamicPageBuilderComponent {
|
|
|
19763
19973
|
});
|
|
19764
19974
|
return this.agenticComponentCapabilitiesPromise;
|
|
19765
19975
|
}
|
|
19976
|
+
async collectRuntimeComponentObservationsForAgenticTurn() {
|
|
19977
|
+
if (!this.runtimeObservationRegistry) {
|
|
19978
|
+
return [];
|
|
19979
|
+
}
|
|
19980
|
+
return this.runtimeObservationRegistry.listActive();
|
|
19981
|
+
}
|
|
19766
19982
|
ensureAgenticTurnController() {
|
|
19767
19983
|
if (!this.agenticTurnController) {
|
|
19768
19984
|
const flow = new PageBuilderAgenticAuthoringTurnFlow(this.agenticAuthoring, {
|
|
@@ -19775,6 +19991,7 @@ class DynamicPageBuilderComponent {
|
|
|
19775
19991
|
apiKey: () => this.agenticAuthoringApiKey,
|
|
19776
19992
|
enableTurnStream: () => this.agenticAuthoringEnableStreaming,
|
|
19777
19993
|
includeLlmDiagnostics: () => this.agenticAuthoringIncludeLlmDiagnostics,
|
|
19994
|
+
collectRuntimeComponentObservations: () => this.collectRuntimeComponentObservationsForAgenticTurn(),
|
|
19778
19995
|
loadComponentCapabilities: () => this.loadAgenticComponentCapabilities(),
|
|
19779
19996
|
applyLocalPreview: (result) => this.applyAgenticPreviewLocally(result),
|
|
19780
19997
|
describePreviewFailure: (result) => this.describeAgenticPreviewFailure(result),
|
|
@@ -19804,7 +20021,7 @@ class DynamicPageBuilderComponent {
|
|
|
19804
20021
|
if (!applied.success && this.isAgenticTableContractError(applied.error)) {
|
|
19805
20022
|
return {
|
|
19806
20023
|
...applied,
|
|
19807
|
-
error: this.tx('agentic.errors.invalidTableContract', '
|
|
20024
|
+
error: this.tx('agentic.errors.invalidTableContract', 'Encontrei a fonte de dados, mas a tabela proposta usa informações que esse componente não aceita. Vou ajustar para usar apenas campos compatíveis.'),
|
|
19808
20025
|
};
|
|
19809
20026
|
}
|
|
19810
20027
|
return applied;
|
|
@@ -19816,7 +20033,7 @@ class DynamicPageBuilderComponent {
|
|
|
19816
20033
|
this.agenticAuthoringConversation.set(state.messages);
|
|
19817
20034
|
this.agenticAuthoringQuickReplies.set(state.quickReplies);
|
|
19818
20035
|
this.agenticAuthoringStatus.set(handoff && !preview?.valid
|
|
19819
|
-
? this.tx('agentic.status.sharedRuleHandoff', 'Continue
|
|
20036
|
+
? this.tx('agentic.status.sharedRuleHandoff', 'Continue este pedido na revisão da regra.')
|
|
19820
20037
|
: state.statusText);
|
|
19821
20038
|
this.agenticAuthoringError.set(state.errorText);
|
|
19822
20039
|
this.agenticAuthoringPreviewResult.set(preview);
|
|
@@ -20018,8 +20235,69 @@ class DynamicPageBuilderComponent {
|
|
|
20018
20235
|
}
|
|
20019
20236
|
return Object.keys(merged).length ? merged : undefined;
|
|
20020
20237
|
}
|
|
20021
|
-
consumeAgenticTurn(states
|
|
20022
|
-
return firstValueFrom(states$.pipe(
|
|
20238
|
+
consumeAgenticTurn(states$, turnRunId) {
|
|
20239
|
+
return firstValueFrom(states$.pipe(takeUntil(this.agenticTurnCancel$), concatMap((state) => {
|
|
20240
|
+
if (!this.isCurrentAgenticTurn(turnRunId)) {
|
|
20241
|
+
return of(state);
|
|
20242
|
+
}
|
|
20243
|
+
return from(this.applyAgenticTurnState(state)).pipe(map(() => state));
|
|
20244
|
+
}), filter((state) => this.isAgenticTurnTerminalState(state)), timeout({
|
|
20245
|
+
first: this.agenticAuthoringTurnTerminalTimeoutMs,
|
|
20246
|
+
with: () => of(this.createAgenticTurnTimeoutState()),
|
|
20247
|
+
}), take(1))).then(async (state) => {
|
|
20248
|
+
if (this.isCurrentAgenticTurn(turnRunId) && this.isAgenticTurnTimeoutState(state)) {
|
|
20249
|
+
await this.applyAgenticTurnState(state);
|
|
20250
|
+
}
|
|
20251
|
+
return state;
|
|
20252
|
+
});
|
|
20253
|
+
}
|
|
20254
|
+
beginAgenticTurn() {
|
|
20255
|
+
this.cancelActiveAgenticTurn();
|
|
20256
|
+
this.agenticTurnRunId += 1;
|
|
20257
|
+
return this.agenticTurnRunId;
|
|
20258
|
+
}
|
|
20259
|
+
cancelActiveAgenticTurn() {
|
|
20260
|
+
this.agenticTurnRunId += 1;
|
|
20261
|
+
this.agenticTurnCancel$.next();
|
|
20262
|
+
}
|
|
20263
|
+
isCurrentAgenticTurn(turnRunId) {
|
|
20264
|
+
return this.agenticTurnRunId === turnRunId;
|
|
20265
|
+
}
|
|
20266
|
+
createAgenticTurnTimeoutState() {
|
|
20267
|
+
const message = this.tx('agentic.errors.streamTimeout', 'Ainda não consegui concluir este pedido. Tente novamente com um pedido mais específico ou revise o contexto ativo.');
|
|
20268
|
+
return {
|
|
20269
|
+
mode: 'agentic-authoring',
|
|
20270
|
+
state: 'error',
|
|
20271
|
+
phase: 'contextualize',
|
|
20272
|
+
statusText: '',
|
|
20273
|
+
errorText: message,
|
|
20274
|
+
messages: [
|
|
20275
|
+
...this.agenticAuthoringConversation(),
|
|
20276
|
+
{
|
|
20277
|
+
id: `${Date.now()}-timeout-error`,
|
|
20278
|
+
role: 'error',
|
|
20279
|
+
text: message,
|
|
20280
|
+
},
|
|
20281
|
+
],
|
|
20282
|
+
quickReplies: [],
|
|
20283
|
+
clarificationQuestions: [],
|
|
20284
|
+
contextItems: this.agenticAuthoringContextItems(),
|
|
20285
|
+
attachments: this.agenticAuthoringAttachments(),
|
|
20286
|
+
canApply: false,
|
|
20287
|
+
preview: null,
|
|
20288
|
+
diagnostics: {
|
|
20289
|
+
timeout: {
|
|
20290
|
+
schemaVersion: 'praxis-page-builder-agentic-turn-timeout.v1',
|
|
20291
|
+
source: 'dynamic-page-builder',
|
|
20292
|
+
elapsedMs: this.agenticAuthoringTurnTerminalTimeoutMs,
|
|
20293
|
+
},
|
|
20294
|
+
},
|
|
20295
|
+
};
|
|
20296
|
+
}
|
|
20297
|
+
isAgenticTurnTimeoutState(state) {
|
|
20298
|
+
const diagnostics = this.toRecord(state.diagnostics);
|
|
20299
|
+
const timeoutDiagnostics = this.toRecord(diagnostics?.['timeout']);
|
|
20300
|
+
return timeoutDiagnostics?.['source'] === 'dynamic-page-builder';
|
|
20023
20301
|
}
|
|
20024
20302
|
isAgenticTurnTerminalState(state) {
|
|
20025
20303
|
return state.state === 'review'
|
|
@@ -20226,16 +20504,16 @@ class DynamicPageBuilderComponent {
|
|
|
20226
20504
|
formatAgenticFailures(failureCodes) {
|
|
20227
20505
|
const codes = (failureCodes ?? []).filter((code) => !!code);
|
|
20228
20506
|
if (codes.length === 0) {
|
|
20229
|
-
return this.tx('agentic.errors.invalidPreview', '
|
|
20507
|
+
return this.tx('agentic.errors.invalidPreview', 'Não consegui montar uma prévia segura para este pedido.');
|
|
20230
20508
|
}
|
|
20231
|
-
return
|
|
20509
|
+
return this.tx('agentic.errors.invalidPreviewWithDetails', 'Não consegui montar uma prévia segura. Revise o pedido ou escolha outra fonte de dados.');
|
|
20232
20510
|
}
|
|
20233
20511
|
describeAgenticPreviewFailure(result) {
|
|
20234
20512
|
switch (result.diagnostics?.fieldScopeDecision) {
|
|
20235
20513
|
case 'rejected-duplicate-field':
|
|
20236
|
-
return this.tx('agentic.errors.duplicateField', '
|
|
20514
|
+
return this.tx('agentic.errors.duplicateField', 'Este campo já existe no formulário selecionado.');
|
|
20237
20515
|
case 'rejected-non-local-field-removal':
|
|
20238
|
-
return this.tx('agentic.errors.nonLocalFieldRemoval', '
|
|
20516
|
+
return this.tx('agentic.errors.nonLocalFieldRemoval', 'Só posso remover, por aqui, campos que foram criados nesta própria prévia.');
|
|
20239
20517
|
default:
|
|
20240
20518
|
return this.formatAgenticFailures(result.failureCodes);
|
|
20241
20519
|
}
|
|
@@ -20249,13 +20527,13 @@ class DynamicPageBuilderComponent {
|
|
|
20249
20527
|
}
|
|
20250
20528
|
switch (result.diagnostics?.fieldScopeDecision) {
|
|
20251
20529
|
case 'accepted-add-local-field':
|
|
20252
|
-
return this.tx('agentic.status.acceptedAddLocalField', '
|
|
20530
|
+
return this.tx('agentic.status.acceptedAddLocalField', 'Campo adicionado ao formulário.');
|
|
20253
20531
|
case 'accepted-remove-local-field':
|
|
20254
|
-
return this.tx('agentic.status.acceptedRemoveLocalField', '
|
|
20532
|
+
return this.tx('agentic.status.acceptedRemoveLocalField', 'Campo removido do formulário.');
|
|
20255
20533
|
case 'accepted-relabel-server-backed-field':
|
|
20256
|
-
return this.tx('agentic.status.acceptedRelabelField', '
|
|
20534
|
+
return this.tx('agentic.status.acceptedRelabelField', 'Nome do campo atualizado.');
|
|
20257
20535
|
default:
|
|
20258
|
-
return this.tx('agentic.status.previewReady', '
|
|
20536
|
+
return this.tx('agentic.status.previewReady', 'Prévia aplicada na tela.');
|
|
20259
20537
|
}
|
|
20260
20538
|
}
|
|
20261
20539
|
isAgenticTableContractError(error) {
|
|
@@ -20278,7 +20556,7 @@ class DynamicPageBuilderComponent {
|
|
|
20278
20556
|
}
|
|
20279
20557
|
describeAgenticError(error) {
|
|
20280
20558
|
if (error?.name === 'TimeoutError') {
|
|
20281
|
-
return this.tx('agentic.errors.streamTimeout', '
|
|
20559
|
+
return this.tx('agentic.errors.streamTimeout', 'O assistente demorou para concluir este pedido. Tente de novo com um recorte menor ou revise o contexto ativo.');
|
|
20282
20560
|
}
|
|
20283
20561
|
if (typeof error?.error?.message === 'string' && error.error.message.trim()) {
|
|
20284
20562
|
return error.error.message.trim();
|
|
@@ -20290,9 +20568,9 @@ class DynamicPageBuilderComponent {
|
|
|
20290
20568
|
return error.message.trim();
|
|
20291
20569
|
}
|
|
20292
20570
|
if (typeof error?.status === 'number') {
|
|
20293
|
-
return
|
|
20571
|
+
return this.tx('agentic.errors.status', 'Não consegui concluir este pedido. Revise a conexão e tente novamente.');
|
|
20294
20572
|
}
|
|
20295
|
-
return this.tx('agentic.errors.generic', '
|
|
20573
|
+
return this.tx('agentic.errors.generic', 'Não consegui concluir este pedido.');
|
|
20296
20574
|
}
|
|
20297
20575
|
cloneValue(value) {
|
|
20298
20576
|
if (value == null || typeof value !== 'object') {
|
|
@@ -20409,7 +20687,7 @@ class DynamicPageBuilderComponent {
|
|
|
20409
20687
|
</header>
|
|
20410
20688
|
@if (!agenticAuthoringLlmDiagnosticsCollapsed()) {
|
|
20411
20689
|
<p class="agentic-diagnostics-panel__description">
|
|
20412
|
-
{{ tx('agentic.diagnostics.description', '
|
|
20690
|
+
{{ tx('agentic.diagnostics.description', 'Informações usadas para explicar como o assistente chegou à resposta deste pedido.') }}
|
|
20413
20691
|
</p>
|
|
20414
20692
|
<pre>{{ agenticAuthoringLlmDiagnosticsText() }}</pre>
|
|
20415
20693
|
}
|
|
@@ -20422,11 +20700,11 @@ class DynamicPageBuilderComponent {
|
|
|
20422
20700
|
[class.shared-rule-cockpit--collapsed]="sharedRuleCockpitCollapsed()"
|
|
20423
20701
|
data-testid="page-builder-shared-rule-cockpit"
|
|
20424
20702
|
role="region"
|
|
20425
|
-
[attr.aria-label]="tx('agentic.sharedRuleCockpit.title', '
|
|
20703
|
+
[attr.aria-label]="tx('agentic.sharedRuleCockpit.title', 'Revisão governada da regra')"
|
|
20426
20704
|
>
|
|
20427
20705
|
<header class="shared-rule-cockpit__header">
|
|
20428
20706
|
<div>
|
|
20429
|
-
<strong>{{ tx('agentic.sharedRuleCockpit.title', '
|
|
20707
|
+
<strong>{{ tx('agentic.sharedRuleCockpit.title', 'Revisão governada da regra') }}</strong>
|
|
20430
20708
|
<span>{{ handoff.ruleKey || handoff.recommendedRuleType || handoff.flowId }}</span>
|
|
20431
20709
|
</div>
|
|
20432
20710
|
<div class="shared-rule-cockpit__header-actions">
|
|
@@ -20446,7 +20724,7 @@ class DynamicPageBuilderComponent {
|
|
|
20446
20724
|
</header>
|
|
20447
20725
|
@if (!sharedRuleCockpitCollapsed()) {
|
|
20448
20726
|
<p class="shared-rule-cockpit__description">
|
|
20449
|
-
{{ tx('agentic.sharedRuleCockpit.description', 'Continue
|
|
20727
|
+
{{ tx('agentic.sharedRuleCockpit.description', 'Continue a revisão da regra de negócio antes de criar ou salvar alterações na tela.') }}
|
|
20450
20728
|
</p>
|
|
20451
20729
|
<div class="shared-rule-cockpit__actions">
|
|
20452
20730
|
@for (action of sharedRuleGovernedContinuationActions(); track trackGovernedContinuationAction($index, action)) {
|
|
@@ -20850,7 +21128,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
20850
21128
|
</header>
|
|
20851
21129
|
@if (!agenticAuthoringLlmDiagnosticsCollapsed()) {
|
|
20852
21130
|
<p class="agentic-diagnostics-panel__description">
|
|
20853
|
-
{{ tx('agentic.diagnostics.description', '
|
|
21131
|
+
{{ tx('agentic.diagnostics.description', 'Informações usadas para explicar como o assistente chegou à resposta deste pedido.') }}
|
|
20854
21132
|
</p>
|
|
20855
21133
|
<pre>{{ agenticAuthoringLlmDiagnosticsText() }}</pre>
|
|
20856
21134
|
}
|
|
@@ -20863,11 +21141,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
20863
21141
|
[class.shared-rule-cockpit--collapsed]="sharedRuleCockpitCollapsed()"
|
|
20864
21142
|
data-testid="page-builder-shared-rule-cockpit"
|
|
20865
21143
|
role="region"
|
|
20866
|
-
[attr.aria-label]="tx('agentic.sharedRuleCockpit.title', '
|
|
21144
|
+
[attr.aria-label]="tx('agentic.sharedRuleCockpit.title', 'Revisão governada da regra')"
|
|
20867
21145
|
>
|
|
20868
21146
|
<header class="shared-rule-cockpit__header">
|
|
20869
21147
|
<div>
|
|
20870
|
-
<strong>{{ tx('agentic.sharedRuleCockpit.title', '
|
|
21148
|
+
<strong>{{ tx('agentic.sharedRuleCockpit.title', 'Revisão governada da regra') }}</strong>
|
|
20871
21149
|
<span>{{ handoff.ruleKey || handoff.recommendedRuleType || handoff.flowId }}</span>
|
|
20872
21150
|
</div>
|
|
20873
21151
|
<div class="shared-rule-cockpit__header-actions">
|
|
@@ -20887,7 +21165,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
20887
21165
|
</header>
|
|
20888
21166
|
@if (!sharedRuleCockpitCollapsed()) {
|
|
20889
21167
|
<p class="shared-rule-cockpit__description">
|
|
20890
|
-
{{ tx('agentic.sharedRuleCockpit.description', 'Continue
|
|
21168
|
+
{{ tx('agentic.sharedRuleCockpit.description', 'Continue a revisão da regra de negócio antes de criar ou salvar alterações na tela.') }}
|
|
20891
21169
|
</p>
|
|
20892
21170
|
<div class="shared-rule-cockpit__actions">
|
|
20893
21171
|
@for (action of sharedRuleGovernedContinuationActions(); track trackGovernedContinuationAction($index, action)) {
|