@mablhq/mabl-cli 2.37.7 → 2.41.1

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.
@@ -67,6 +67,13 @@ class IfConditionStep extends MablStep_1.MablStep {
67
67
  details.conditionOptions = this.conditionAction.hasOptionsAtInstantiation
68
68
  ? optionalConditionOptions
69
69
  : undefined;
70
+ if (this.conditionAction.conditionDescriptor.conditionType ===
71
+ ConditionDescriptor_1.ConditionType.AIPrompt) {
72
+ details.userPrompt =
73
+ this.conditionAction.conditionDescriptor.userPrompt;
74
+ details.metaPrompt =
75
+ this.conditionAction.conditionDescriptor.metaPrompt;
76
+ }
70
77
  }
71
78
  if (this.primaryAction instanceof GetVariableValue_1.GetVariableValue) {
72
79
  details.variableName = this.substituteMablscriptVariable(this.primaryAction.variable);
@@ -125,16 +132,28 @@ class IfConditionStep extends MablStep_1.MablStep {
125
132
  }
126
133
  if (stepArgs.condition) {
127
134
  const conditionType = ConditionDescriptor_1.AssertionStepNameToField[stepArgs.condition];
128
- actions.push(new ConditionAction_1.ConditionAction(conditionType === 'present' || conditionType === 'not_present'
129
- ? 'evaluate_presence'
130
- : 'evaluate_condition', [
131
- ConditionDescriptor_1.AssertionStepNameToField[stepArgs.condition],
132
- stepArgs.conditionValue,
133
- stepArgs.conditionOptions,
134
- ]));
135
+ if (conditionType === 'ai_prompt') {
136
+ actions.push(new ConditionAction_1.ConditionAction(this.getConditionActionNameForConditionType(conditionType), [stepArgs.userPrompt, stepArgs.metaPrompt]));
137
+ }
138
+ else {
139
+ actions.push(new ConditionAction_1.ConditionAction(this.getConditionActionNameForConditionType(conditionType), [
140
+ ConditionDescriptor_1.AssertionStepNameToField[stepArgs.condition],
141
+ stepArgs.conditionValue,
142
+ stepArgs.conditionOptions,
143
+ ]));
144
+ }
135
145
  }
136
146
  return actions;
137
147
  }
148
+ static getConditionActionNameForConditionType(conditionType) {
149
+ if (conditionType === 'present' || conditionType === 'not_present') {
150
+ return 'evaluate_presence';
151
+ }
152
+ else if (conditionType === 'ai_prompt') {
153
+ return 'evaluate_ai_prompt';
154
+ }
155
+ return 'evaluate_condition';
156
+ }
138
157
  static fromYaml(_stepName, stepArgs) {
139
158
  const actions = IfConditionStep.getActionsFromYamlForCondition(stepArgs);
140
159
  const step = new IfConditionStep('conditional_if', [], actions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mablhq/mabl-cli",
3
- "version": "2.37.7",
3
+ "version": "2.41.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "The official mabl command line interface tool",
6
6
  "main": "index.js",
@@ -77,8 +77,8 @@
77
77
  "open": "6.4.0",
78
78
  "ora": "4.0.4",
79
79
  "pixelmatch": "5.3.0",
80
- "playwright": "1.45.3",
81
- "playwright-core": "1.45.3",
80
+ "playwright": "1.46.1",
81
+ "playwright-core": "1.46.1",
82
82
  "pluralize": "8.0.0",
83
83
  "pngjs": "6.0.0",
84
84
  "portfinder": "1.0.28",