@praxisui/stepper 8.0.0-beta.32 → 8.0.0-beta.34

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.
@@ -3113,7 +3113,7 @@ class StepperAgenticAuthoringTurnFlow {
3113
3113
  const schemaFields = this.adapter.getSchemaFields?.()
3114
3114
  ?.map((field) => this.toAiJsonObject(field))
3115
3115
  .filter((field) => Object.keys(field).length > 0);
3116
- const contextHints = this.optionalJsonObject(this.adapter.getAuthoringContext?.());
3116
+ const contextHints = this.mergeJsonObjects(this.optionalJsonObject(this.adapter.getAuthoringContext?.()), this.optionalJsonObject(request.action?.contextHints));
3117
3117
  if (this.shouldRouteToGovernedDecision(prompt, contextHints)) {
3118
3118
  return this.toGovernedDecisionHandoff(prompt, request);
3119
3119
  }
@@ -3169,6 +3169,7 @@ class StepperAgenticAuthoringTurnFlow {
3169
3169
  state: 'clarification',
3170
3170
  phase: 'clarify',
3171
3171
  sessionId: response.sessionId ?? request.sessionId,
3172
+ observationId: response.observationId ?? request.observationId ?? null,
3172
3173
  assistantMessage: response.message || 'Preciso de mais detalhes para continuar.',
3173
3174
  clarificationQuestions: this.toClarificationQuestions(response),
3174
3175
  quickReplies: this.toQuickReplies(response),
@@ -3185,6 +3186,7 @@ class StepperAgenticAuthoringTurnFlow {
3185
3186
  state: 'error',
3186
3187
  phase: 'capture',
3187
3188
  sessionId: response.sessionId ?? request.sessionId,
3189
+ observationId: response.observationId ?? request.observationId ?? null,
3188
3190
  assistantMessage: message,
3189
3191
  errorText: message,
3190
3192
  diagnostics: response.warnings?.length ? { warnings: response.warnings } : undefined,
@@ -3195,6 +3197,7 @@ class StepperAgenticAuthoringTurnFlow {
3195
3197
  state: 'error',
3196
3198
  phase: 'review',
3197
3199
  sessionId: response.sessionId ?? request.sessionId,
3200
+ observationId: response.observationId ?? request.observationId ?? null,
3198
3201
  assistantMessage: 'O stepper rejeitou patch livre. Gere um componentEditPlan validado pelo PRAXIS_STEPPER_AUTHORING_MANIFEST antes de propor alteracao local.',
3199
3202
  errorText: 'Patch livre de stepper rejeitado.',
3200
3203
  canApply: false,
@@ -3211,6 +3214,7 @@ class StepperAgenticAuthoringTurnFlow {
3211
3214
  state: 'success',
3212
3215
  phase: 'summarize',
3213
3216
  sessionId: response.sessionId ?? request.sessionId,
3217
+ observationId: response.observationId ?? request.observationId ?? null,
3214
3218
  assistantMessage: response.message || response.explanation || 'Nenhuma alteracao necessaria.',
3215
3219
  statusText: response.message || response.explanation || 'Nenhuma alteracao necessaria.',
3216
3220
  canApply: false,
@@ -3241,7 +3245,13 @@ class StepperAgenticAuthoringTurnFlow {
3241
3245
  const labels = response.questions?.length
3242
3246
  ? response.questions
3243
3247
  : response.message ? [response.message] : ['Qual ajuste voce quer aplicar no stepper?'];
3244
- const options = this.toQuickReplies(response).map((reply) => ({ id: reply.id, label: reply.label, value: reply.prompt }));
3248
+ const options = this.toQuickReplies(response).map((reply) => ({
3249
+ id: reply.id,
3250
+ label: reply.label,
3251
+ value: reply.prompt,
3252
+ description: reply.description ?? undefined,
3253
+ contextHints: reply.contextHints ? { ...reply.contextHints } : undefined,
3254
+ }));
3245
3255
  return labels.map((label, index) => ({
3246
3256
  id: `stepper-clarification-${index + 1}`,
3247
3257
  type: options.length ? 'single-choice' : 'text',
@@ -3255,8 +3265,15 @@ class StepperAgenticAuthoringTurnFlow {
3255
3265
  if (payloads.length) {
3256
3266
  return payloads.map((option, index) => {
3257
3267
  const label = option.label?.trim() || option.value?.trim() || `Opcao ${index + 1}`;
3258
- const prompt = option.example?.trim() || option.value?.trim() || label;
3259
- return { id: `option-${index + 1}`, label, prompt, kind: 'clarification-option' };
3268
+ const prompt = option.value?.trim() || option.example?.trim() || label;
3269
+ return {
3270
+ id: `option-${index + 1}`,
3271
+ label,
3272
+ prompt,
3273
+ kind: 'clarification-option',
3274
+ description: option.example?.trim() || undefined,
3275
+ contextHints: this.optionalJsonObject(option.contextHints),
3276
+ };
3260
3277
  });
3261
3278
  }
3262
3279
  return (response.options ?? [])
@@ -3328,6 +3345,16 @@ class StepperAgenticAuthoringTurnFlow {
3328
3345
  const object = this.toAiJsonObject(value);
3329
3346
  return Object.keys(object).length ? object : undefined;
3330
3347
  }
3348
+ mergeJsonObjects(base, overlay) {
3349
+ if (!base)
3350
+ return overlay;
3351
+ if (!overlay)
3352
+ return base;
3353
+ return {
3354
+ ...base,
3355
+ ...overlay,
3356
+ };
3357
+ }
3331
3358
  toAiJsonObject(value) {
3332
3359
  const record = this.toRecord(value);
3333
3360
  if (!record)
@@ -3698,12 +3725,21 @@ class PraxisStepper {
3698
3725
  if (!controller)
3699
3726
  return;
3700
3727
  const state = controller.snapshot();
3728
+ const contextHints = reply.contextHints ? { ...reply.contextHints } : undefined;
3701
3729
  const next$ = state.state === 'clarification'
3702
- ? controller.answerClarification(reply.prompt)
3730
+ ? controller.answerClarification({
3731
+ id: reply.id,
3732
+ label: reply.label,
3733
+ value: reply.prompt,
3734
+ description: reply.description ?? undefined,
3735
+ contextHints,
3736
+ })
3703
3737
  : controller.submitPrompt(reply.prompt, {
3704
3738
  kind: reply.kind || 'quick-reply',
3705
3739
  id: reply.id,
3706
3740
  value: reply.prompt,
3741
+ displayPrompt: reply.label,
3742
+ contextHints,
3707
3743
  });
3708
3744
  next$.subscribe((nextState) => {
3709
3745
  this.aiAssistantPrompt = '';
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@praxisui/stepper",
3
- "version": "8.0.0-beta.32",
3
+ "version": "8.0.0-beta.34",
4
4
  "description": "Stepper workflows for Praxis UI with integrated forms, lists, uploads and page builder support.",
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.32",
11
- "@praxisui/dynamic-form": "^8.0.0-beta.32",
12
- "@praxisui/rich-content": "^8.0.0-beta.32",
13
- "@praxisui/settings-panel": "^8.0.0-beta.32",
14
- "@praxisui/list": "^8.0.0-beta.32",
15
- "@praxisui/files-upload": "^8.0.0-beta.32",
16
- "@praxisui/page-builder": "^8.0.0-beta.32",
10
+ "@praxisui/core": "^8.0.0-beta.34",
11
+ "@praxisui/dynamic-form": "^8.0.0-beta.34",
12
+ "@praxisui/rich-content": "^8.0.0-beta.34",
13
+ "@praxisui/settings-panel": "^8.0.0-beta.34",
14
+ "@praxisui/list": "^8.0.0-beta.34",
15
+ "@praxisui/files-upload": "^8.0.0-beta.34",
16
+ "@praxisui/page-builder": "^8.0.0-beta.34",
17
17
  "@angular/forms": "^21.0.0",
18
18
  "@angular/router": "^21.0.0",
19
- "@praxisui/ai": "^8.0.0-beta.32",
19
+ "@praxisui/ai": "^8.0.0-beta.34",
20
20
  "rxjs": "~7.8.0"
21
21
  },
22
22
  "dependencies": {