@praxisui/manual-form 8.0.0-beta.33 → 8.0.0-beta.35
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.
|
@@ -1247,7 +1247,7 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1247
1247
|
const schemaFields = this.adapter.getSchemaFields?.()
|
|
1248
1248
|
?.map((field) => this.toAiJsonObject(field))
|
|
1249
1249
|
.filter((field) => Object.keys(field).length > 0);
|
|
1250
|
-
const contextHints = this.optionalJsonObject(this.adapter.getAuthoringContext?.());
|
|
1250
|
+
const contextHints = this.mergeJsonObjects(this.optionalJsonObject(this.adapter.getAuthoringContext?.()), this.optionalJsonObject(request.action?.contextHints));
|
|
1251
1251
|
if (this.shouldRouteToGovernedDecision(prompt, contextHints)) {
|
|
1252
1252
|
return this.toGovernedDecisionHandoff(prompt, request);
|
|
1253
1253
|
}
|
|
@@ -1315,6 +1315,7 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1315
1315
|
state: 'clarification',
|
|
1316
1316
|
phase: 'clarify',
|
|
1317
1317
|
sessionId: response.sessionId ?? request.sessionId,
|
|
1318
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
1318
1319
|
assistantMessage: response.message || 'Preciso de mais detalhes para continuar.',
|
|
1319
1320
|
clarificationQuestions: this.toClarificationQuestions(response),
|
|
1320
1321
|
quickReplies: this.toQuickReplies(response),
|
|
@@ -1327,6 +1328,7 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1327
1328
|
state: 'success',
|
|
1328
1329
|
phase: 'summarize',
|
|
1329
1330
|
sessionId: response.sessionId ?? request.sessionId,
|
|
1331
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
1330
1332
|
assistantMessage: message,
|
|
1331
1333
|
statusText: message,
|
|
1332
1334
|
canApply: false,
|
|
@@ -1338,6 +1340,7 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1338
1340
|
state: 'error',
|
|
1339
1341
|
phase: 'capture',
|
|
1340
1342
|
sessionId: response.sessionId ?? request.sessionId,
|
|
1343
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
1341
1344
|
assistantMessage: message,
|
|
1342
1345
|
errorText: message,
|
|
1343
1346
|
diagnostics: response.warnings?.length ? { warnings: response.warnings } : undefined,
|
|
@@ -1348,6 +1351,7 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1348
1351
|
state: 'error',
|
|
1349
1352
|
phase: 'review',
|
|
1350
1353
|
sessionId: response.sessionId ?? request.sessionId,
|
|
1354
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
1351
1355
|
assistantMessage: 'O formulario manual rejeitou patch livre. Gere um componentEditPlan validado pelo PRAXIS_MANUAL_FORM_AUTHORING_MANIFEST antes de propor alteracao local.',
|
|
1352
1356
|
errorText: 'Patch livre de formulario manual rejeitado.',
|
|
1353
1357
|
canApply: false,
|
|
@@ -1364,6 +1368,7 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1364
1368
|
state: 'success',
|
|
1365
1369
|
phase: 'summarize',
|
|
1366
1370
|
sessionId: response.sessionId ?? request.sessionId,
|
|
1371
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
1367
1372
|
assistantMessage: response.message || response.explanation || 'Nenhuma alteracao necessaria.',
|
|
1368
1373
|
statusText: response.message || response.explanation || 'Nenhuma alteracao necessaria.',
|
|
1369
1374
|
canApply: false,
|
|
@@ -1412,6 +1417,8 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1412
1417
|
id: reply.id,
|
|
1413
1418
|
label: reply.label,
|
|
1414
1419
|
value: reply.prompt,
|
|
1420
|
+
description: reply.description ?? undefined,
|
|
1421
|
+
contextHints: reply.contextHints ? { ...reply.contextHints } : undefined,
|
|
1415
1422
|
}));
|
|
1416
1423
|
return labels.map((label, index) => ({
|
|
1417
1424
|
id: `manual-form-clarification-${index + 1}`,
|
|
@@ -1427,12 +1434,14 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1427
1434
|
return payloads
|
|
1428
1435
|
.map((option, index) => {
|
|
1429
1436
|
const label = option.label?.trim() || option.value?.trim() || `Opcao ${index + 1}`;
|
|
1430
|
-
const prompt = option.
|
|
1437
|
+
const prompt = option.value?.trim() || option.example?.trim() || label;
|
|
1431
1438
|
return {
|
|
1432
1439
|
id: `option-${index + 1}`,
|
|
1433
1440
|
label,
|
|
1434
1441
|
prompt,
|
|
1435
1442
|
kind: 'clarification-option',
|
|
1443
|
+
description: option.example?.trim() || undefined,
|
|
1444
|
+
contextHints: this.optionalJsonObject(option.contextHints),
|
|
1436
1445
|
};
|
|
1437
1446
|
});
|
|
1438
1447
|
}
|
|
@@ -1514,6 +1523,16 @@ class ManualFormAgenticAuthoringTurnFlow {
|
|
|
1514
1523
|
const object = this.toAiJsonObject(value);
|
|
1515
1524
|
return Object.keys(object).length ? object : undefined;
|
|
1516
1525
|
}
|
|
1526
|
+
mergeJsonObjects(base, overlay) {
|
|
1527
|
+
if (!base)
|
|
1528
|
+
return overlay;
|
|
1529
|
+
if (!overlay)
|
|
1530
|
+
return base;
|
|
1531
|
+
return {
|
|
1532
|
+
...base,
|
|
1533
|
+
...overlay,
|
|
1534
|
+
};
|
|
1535
|
+
}
|
|
1517
1536
|
toAiJsonObject(value) {
|
|
1518
1537
|
const record = this.toRecord(value);
|
|
1519
1538
|
if (!record) {
|
|
@@ -2388,12 +2407,21 @@ class ManualFormComponent {
|
|
|
2388
2407
|
if (!controller)
|
|
2389
2408
|
return;
|
|
2390
2409
|
const state = controller.snapshot();
|
|
2410
|
+
const contextHints = reply.contextHints ? { ...reply.contextHints } : undefined;
|
|
2391
2411
|
const next$ = state.state === 'clarification'
|
|
2392
|
-
? controller.answerClarification(
|
|
2412
|
+
? controller.answerClarification({
|
|
2413
|
+
id: reply.id,
|
|
2414
|
+
label: reply.label,
|
|
2415
|
+
value: reply.prompt,
|
|
2416
|
+
description: reply.description ?? undefined,
|
|
2417
|
+
contextHints,
|
|
2418
|
+
})
|
|
2393
2419
|
: controller.submitPrompt(reply.prompt, {
|
|
2394
2420
|
kind: reply.kind || 'quick-reply',
|
|
2395
2421
|
id: reply.id,
|
|
2396
2422
|
value: reply.prompt,
|
|
2423
|
+
displayPrompt: reply.label,
|
|
2424
|
+
contextHints,
|
|
2397
2425
|
});
|
|
2398
2426
|
next$.subscribe((nextState) => {
|
|
2399
2427
|
this.aiAssistantPrompt = '';
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/manual-form",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.35",
|
|
4
4
|
"description": "Manual form toolkit for Praxis UI: container, instance factory and editor bridge for @praxisui/* fields.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
7
7
|
"@angular/core": "^21.0.0",
|
|
8
|
-
"@praxisui/core": "^8.0.0-beta.
|
|
9
|
-
"@praxisui/dynamic-fields": "^8.0.0-beta.
|
|
10
|
-
"@praxisui/settings-panel": "^8.0.0-beta.
|
|
11
|
-
"@praxisui/metadata-editor": "^8.0.0-beta.
|
|
8
|
+
"@praxisui/core": "^8.0.0-beta.35",
|
|
9
|
+
"@praxisui/dynamic-fields": "^8.0.0-beta.35",
|
|
10
|
+
"@praxisui/settings-panel": "^8.0.0-beta.35",
|
|
11
|
+
"@praxisui/metadata-editor": "^8.0.0-beta.35",
|
|
12
12
|
"@angular/cdk": "^21.0.0",
|
|
13
13
|
"@angular/forms": "^21.0.0",
|
|
14
14
|
"@angular/material": "^21.0.0",
|
|
15
15
|
"@angular/router": "^21.0.0",
|
|
16
|
-
"@praxisui/ai": "^8.0.0-beta.
|
|
16
|
+
"@praxisui/ai": "^8.0.0-beta.35",
|
|
17
17
|
"rxjs": "~7.8.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|