@praxisui/page-builder 8.0.0-beta.0 → 8.0.0-beta.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.
- package/README.md +38 -0
- package/fesm2022/praxisui-page-builder.mjs +1731 -17
- package/index.d.ts +243 -32
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ Peer dependencies (Angular v20):
|
|
|
28
28
|
- `@angular/forms` `^20.0.0`
|
|
29
29
|
- `@angular/cdk` `^20.0.0`
|
|
30
30
|
- `@angular/material` `^20.0.0`
|
|
31
|
+
- `@praxisui/ai` `*`
|
|
31
32
|
- `@praxisui/core` `*`
|
|
32
33
|
- `@praxisui/settings-panel` `*`
|
|
33
34
|
|
|
@@ -89,6 +90,41 @@ registerWidgetAiCatalogs({
|
|
|
89
90
|
Registro via token:
|
|
90
91
|
- Use o InjectionToken `PAGE_BUILDER_WIDGET_AI_CATALOGS` para fornecer o mapa no host.
|
|
91
92
|
|
|
93
|
+
## Agentic Authoring
|
|
94
|
+
|
|
95
|
+
Para gerar uma página a partir de um prompt usando o backend canônico do `praxis-config-starter`, configure `PageBuilderAgenticAuthoringService` com o endpoint interno opt-in `/api/praxis/config/ai/authoring`.
|
|
96
|
+
|
|
97
|
+
O chrome conversacional do assistente usa `PraxisAiAssistantShellComponent` de `@praxisui/ai`. O Page Builder continua dono da semântica agentic de página: resolução de intenção, preview, apply, save, reopen e compilação do plano validado para `WidgetPageDefinition`.
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { PAGE_BUILDER_AGENTIC_AUTHORING_OPTIONS } from '@praxisui/page-builder';
|
|
101
|
+
|
|
102
|
+
providers: [
|
|
103
|
+
{
|
|
104
|
+
provide: PAGE_BUILDER_AGENTIC_AUTHORING_OPTIONS,
|
|
105
|
+
useValue: {
|
|
106
|
+
baseUrl: '/api/praxis/config/ai/authoring',
|
|
107
|
+
headersFactory: () => ({
|
|
108
|
+
'X-Tenant-ID': tenantId,
|
|
109
|
+
'X-User-ID': userId,
|
|
110
|
+
'X-Env': 'local',
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Fluxo canônico:
|
|
118
|
+
|
|
119
|
+
- `resolveIntent` envia prompt, pagina atual e widget selecionado para resolver operacao, recurso, schema, surface e elegibilidade.
|
|
120
|
+
- `previewPage` envia o prompt junto de `intentResolution` elegivel e recebe `MinimalFormPlan` + `CompiledFormPatch`.
|
|
121
|
+
- `resolveIntent` e `previewPage` tambem aceitam `sessionId`, `clientTurnId`, `conversationMessages`, `pendingClarification` e `attachmentSummaries` para que respostas curtas e contexto anexado continuem o turno sem reescrever o prompt no frontend.
|
|
122
|
+
- `attachmentSummaries` deve conter apenas metadados serializaveis (`id`, `name`, `kind`, `mimeType`, `sizeBytes`, `source`, `hasPreview`). O frontend nao envia `File`, bytes, base64 nem URLs locais `blob:`. Quando uma pergunta de clarificacao nasce de um turno com anexos, o backend pode ecoar esses resumos em `pendingClarification.diagnostics.attachmentSummaries`; o Page Builder reenvia esse estado no proximo turno.
|
|
123
|
+
- `PageBuilderAiAdapter.applyCompiledFormPatch` aplica somente `compiledFormPatch.patch.page` no runtime do builder.
|
|
124
|
+
- `applyPage` persiste o mesmo `patch.page` em `ui_user_config`, com `componentType`, `componentId`, `scope` e `If-Match` delegados ao backend canônico.
|
|
125
|
+
|
|
126
|
+
O frontend não deve persistir o envelope completo do patch como payload de runtime. O envelope fica para preview, auditoria e diagnóstico; o documento salvo é a página renderizável.
|
|
127
|
+
|
|
92
128
|
## Settings Panel Bridge
|
|
93
129
|
|
|
94
130
|
Para abrir "Configuracoes da Pagina" e editores de shell no painel lateral, o host deve registrar o bridge do Settings Panel:
|
|
@@ -204,6 +240,8 @@ Exports deste pacote:
|
|
|
204
240
|
- `WidgetShellEditorComponent`
|
|
205
241
|
- `DynamicPageConfigEditorComponent`
|
|
206
242
|
- `DynamicPageBuilderComponent`
|
|
243
|
+
- `PageBuilderAgenticAuthoringService`
|
|
244
|
+
- `PAGE_BUILDER_AGENTIC_AUTHORING_OPTIONS`
|
|
207
245
|
|
|
208
246
|
Integracoes comuns:
|
|
209
247
|
- `SettingsPanelService.open({ id, title, content: { component, inputs } })` para page settings e shell editors
|