@praxisui/tabs 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.
- package/fesm2022/praxisui-tabs.mjs +32 -3
- package/package.json +5 -5
|
@@ -2757,7 +2757,7 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
2757
2757
|
const schemaFields = this.adapter.getSchemaFields?.()
|
|
2758
2758
|
?.map((field) => this.toAiJsonObject(field))
|
|
2759
2759
|
.filter((field) => Object.keys(field).length > 0);
|
|
2760
|
-
const contextHints = this.optionalJsonObject(this.adapter.getAuthoringContext?.());
|
|
2760
|
+
const contextHints = this.mergeJsonObjects(this.optionalJsonObject(this.adapter.getAuthoringContext?.()), this.optionalJsonObject(request.action?.contextHints));
|
|
2761
2761
|
if (this.shouldRouteToGovernedDecision(prompt, contextHints)) {
|
|
2762
2762
|
return this.toGovernedDecisionHandoff(prompt, request);
|
|
2763
2763
|
}
|
|
@@ -2848,6 +2848,7 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
2848
2848
|
state: 'clarification',
|
|
2849
2849
|
phase: 'clarify',
|
|
2850
2850
|
sessionId: response.sessionId ?? request.sessionId,
|
|
2851
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
2851
2852
|
assistantMessage: response.message || 'Preciso de mais detalhes para continuar.',
|
|
2852
2853
|
clarificationQuestions: this.toClarificationQuestions(response),
|
|
2853
2854
|
quickReplies: this.toQuickReplies(response),
|
|
@@ -2860,6 +2861,7 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
2860
2861
|
state: 'success',
|
|
2861
2862
|
phase: 'summarize',
|
|
2862
2863
|
sessionId: response.sessionId ?? request.sessionId,
|
|
2864
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
2863
2865
|
assistantMessage: message,
|
|
2864
2866
|
statusText: message,
|
|
2865
2867
|
canApply: false,
|
|
@@ -2871,6 +2873,7 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
2871
2873
|
state: 'error',
|
|
2872
2874
|
phase: 'capture',
|
|
2873
2875
|
sessionId: response.sessionId ?? request.sessionId,
|
|
2876
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
2874
2877
|
assistantMessage: message,
|
|
2875
2878
|
errorText: message,
|
|
2876
2879
|
canApply: false,
|
|
@@ -2885,6 +2888,7 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
2885
2888
|
state: 'review',
|
|
2886
2889
|
phase: 'review',
|
|
2887
2890
|
sessionId: response.sessionId ?? request.sessionId,
|
|
2891
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
2888
2892
|
assistantMessage: response.explanation || 'Proposta de abas pronta para revisar.',
|
|
2889
2893
|
statusText: 'Revise a proposta antes de aplicar.',
|
|
2890
2894
|
canApply: true,
|
|
@@ -2900,6 +2904,7 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
2900
2904
|
state: 'error',
|
|
2901
2905
|
phase: 'review',
|
|
2902
2906
|
sessionId: response.sessionId ?? request.sessionId,
|
|
2907
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
2903
2908
|
assistantMessage: 'As abas rejeitaram patch livre. Gere um componentEditPlan validado pelo PRAXIS_TABS_AUTHORING_MANIFEST antes de propor alteracao local.',
|
|
2904
2909
|
errorText: 'Patch livre de abas rejeitado.',
|
|
2905
2910
|
canApply: false,
|
|
@@ -2916,6 +2921,7 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
2916
2921
|
state: 'success',
|
|
2917
2922
|
phase: 'summarize',
|
|
2918
2923
|
sessionId: response.sessionId ?? request.sessionId,
|
|
2924
|
+
observationId: response.observationId ?? request.observationId ?? null,
|
|
2919
2925
|
assistantMessage: response.message || response.explanation || 'Nenhuma alteracao necessaria.',
|
|
2920
2926
|
statusText: response.message || response.explanation || 'Nenhuma alteracao necessaria.',
|
|
2921
2927
|
canApply: false,
|
|
@@ -2974,6 +2980,8 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
2974
2980
|
id: reply.id,
|
|
2975
2981
|
label: reply.label,
|
|
2976
2982
|
value: reply.prompt,
|
|
2983
|
+
description: reply.description ?? undefined,
|
|
2984
|
+
contextHints: reply.contextHints ? { ...reply.contextHints } : undefined,
|
|
2977
2985
|
}));
|
|
2978
2986
|
return labels.map((label, index) => ({
|
|
2979
2987
|
id: `tabs-clarification-${index + 1}`,
|
|
@@ -2989,12 +2997,14 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
2989
2997
|
return payloads
|
|
2990
2998
|
.map((option, index) => {
|
|
2991
2999
|
const label = option.label?.trim() || option.value?.trim() || `Opcao ${index + 1}`;
|
|
2992
|
-
const prompt = option.
|
|
3000
|
+
const prompt = option.value?.trim() || option.example?.trim() || label;
|
|
2993
3001
|
return {
|
|
2994
3002
|
id: `option-${index + 1}`,
|
|
2995
3003
|
label,
|
|
2996
3004
|
prompt,
|
|
2997
3005
|
kind: 'clarification-option',
|
|
3006
|
+
description: option.example?.trim() || undefined,
|
|
3007
|
+
contextHints: this.optionalJsonObject(option.contextHints),
|
|
2998
3008
|
};
|
|
2999
3009
|
});
|
|
3000
3010
|
}
|
|
@@ -3078,6 +3088,16 @@ class TabsAgenticAuthoringTurnFlow {
|
|
|
3078
3088
|
const object = this.toAiJsonObject(value);
|
|
3079
3089
|
return Object.keys(object).length ? object : undefined;
|
|
3080
3090
|
}
|
|
3091
|
+
mergeJsonObjects(base, overlay) {
|
|
3092
|
+
if (!base)
|
|
3093
|
+
return overlay;
|
|
3094
|
+
if (!overlay)
|
|
3095
|
+
return base;
|
|
3096
|
+
return {
|
|
3097
|
+
...base,
|
|
3098
|
+
...overlay,
|
|
3099
|
+
};
|
|
3100
|
+
}
|
|
3081
3101
|
toAiJsonObject(value) {
|
|
3082
3102
|
const record = this.toRecord(value);
|
|
3083
3103
|
if (!record) {
|
|
@@ -3499,12 +3519,21 @@ class PraxisTabs {
|
|
|
3499
3519
|
if (!controller)
|
|
3500
3520
|
return;
|
|
3501
3521
|
const state = controller.snapshot();
|
|
3522
|
+
const contextHints = reply.contextHints ? { ...reply.contextHints } : undefined;
|
|
3502
3523
|
const next$ = state.state === 'clarification'
|
|
3503
|
-
? controller.answerClarification(
|
|
3524
|
+
? controller.answerClarification({
|
|
3525
|
+
id: reply.id,
|
|
3526
|
+
label: reply.label,
|
|
3527
|
+
value: reply.prompt,
|
|
3528
|
+
description: reply.description ?? undefined,
|
|
3529
|
+
contextHints,
|
|
3530
|
+
})
|
|
3504
3531
|
: controller.submitPrompt(reply.prompt, {
|
|
3505
3532
|
kind: reply.kind || 'quick-reply',
|
|
3506
3533
|
id: reply.id,
|
|
3507
3534
|
value: reply.prompt,
|
|
3535
|
+
displayPrompt: reply.label,
|
|
3536
|
+
contextHints,
|
|
3508
3537
|
});
|
|
3509
3538
|
next$.subscribe((nextState) => {
|
|
3510
3539
|
this.aiAssistantPrompt = '';
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/tabs",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.35",
|
|
4
4
|
"description": "Configurable tabs (group and nav) for Praxis UI with metadata-driven content and runtime editor.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
7
7
|
"@angular/core": "^21.0.0",
|
|
8
8
|
"@angular/material": "^21.0.0",
|
|
9
9
|
"@angular/cdk": "^21.0.0",
|
|
10
|
-
"@praxisui/core": "^8.0.0-beta.
|
|
11
|
-
"@praxisui/dynamic-fields": "^8.0.0-beta.
|
|
12
|
-
"@praxisui/settings-panel": "^8.0.0-beta.
|
|
10
|
+
"@praxisui/core": "^8.0.0-beta.35",
|
|
11
|
+
"@praxisui/dynamic-fields": "^8.0.0-beta.35",
|
|
12
|
+
"@praxisui/settings-panel": "^8.0.0-beta.35",
|
|
13
13
|
"@angular/forms": "^21.0.0",
|
|
14
14
|
"@angular/router": "^21.0.0",
|
|
15
|
-
"@praxisui/ai": "^8.0.0-beta.
|
|
15
|
+
"@praxisui/ai": "^8.0.0-beta.35",
|
|
16
16
|
"rxjs": "~7.8.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|