@eidra-umain/greenlight 0.2.0 → 0.4.0

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.
Files changed (98) hide show
  1. package/README.md +265 -22
  2. package/dist/browser/browser.d.ts.map +1 -1
  3. package/dist/browser/browser.js +50 -14
  4. package/dist/browser/browser.js.map +1 -1
  5. package/dist/cli/index.js +2 -2
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/cli/run.d.ts.map +1 -1
  8. package/dist/cli/run.js +170 -55
  9. package/dist/cli/run.js.map +1 -1
  10. package/dist/parser/loader.d.ts +12 -3
  11. package/dist/parser/loader.d.ts.map +1 -1
  12. package/dist/parser/loader.js +53 -5
  13. package/dist/parser/loader.js.map +1 -1
  14. package/dist/parser/schema.d.ts +24 -3
  15. package/dist/parser/schema.d.ts.map +1 -1
  16. package/dist/parser/schema.js +12 -2
  17. package/dist/parser/schema.js.map +1 -1
  18. package/dist/pilot/a11y-parser.d.ts +6 -1
  19. package/dist/pilot/a11y-parser.d.ts.map +1 -1
  20. package/dist/pilot/a11y-parser.js +25 -4
  21. package/dist/pilot/a11y-parser.js.map +1 -1
  22. package/dist/pilot/assertions.d.ts +0 -4
  23. package/dist/pilot/assertions.d.ts.map +1 -1
  24. package/dist/pilot/assertions.js +173 -43
  25. package/dist/pilot/assertions.js.map +1 -1
  26. package/dist/pilot/conditions.d.ts +15 -0
  27. package/dist/pilot/conditions.d.ts.map +1 -0
  28. package/dist/pilot/conditions.js +77 -0
  29. package/dist/pilot/conditions.js.map +1 -0
  30. package/dist/pilot/datepick.d.ts +21 -0
  31. package/dist/pilot/datepick.d.ts.map +1 -0
  32. package/dist/pilot/datepick.js +187 -0
  33. package/dist/pilot/datepick.js.map +1 -0
  34. package/dist/pilot/executor.d.ts +1 -1
  35. package/dist/pilot/executor.d.ts.map +1 -1
  36. package/dist/pilot/executor.js +134 -59
  37. package/dist/pilot/executor.js.map +1 -1
  38. package/dist/pilot/llm.d.ts +2 -0
  39. package/dist/pilot/llm.d.ts.map +1 -1
  40. package/dist/pilot/llm.js +60 -3
  41. package/dist/pilot/llm.js.map +1 -1
  42. package/dist/pilot/locator.d.ts +14 -2
  43. package/dist/pilot/locator.d.ts.map +1 -1
  44. package/dist/pilot/locator.js +137 -34
  45. package/dist/pilot/locator.js.map +1 -1
  46. package/dist/pilot/message-builder.d.ts +7 -1
  47. package/dist/pilot/message-builder.d.ts.map +1 -1
  48. package/dist/pilot/message-builder.js +18 -5
  49. package/dist/pilot/message-builder.js.map +1 -1
  50. package/dist/pilot/pilot.d.ts +5 -1
  51. package/dist/pilot/pilot.d.ts.map +1 -1
  52. package/dist/pilot/pilot.js +194 -21
  53. package/dist/pilot/pilot.js.map +1 -1
  54. package/dist/pilot/prompts.d.ts +38 -3
  55. package/dist/pilot/prompts.d.ts.map +1 -1
  56. package/dist/pilot/prompts.js +315 -125
  57. package/dist/pilot/prompts.js.map +1 -1
  58. package/dist/pilot/random.d.ts +37 -0
  59. package/dist/pilot/random.d.ts.map +1 -0
  60. package/dist/pilot/random.js +55 -0
  61. package/dist/pilot/random.js.map +1 -0
  62. package/dist/pilot/response-parser.d.ts +30 -2
  63. package/dist/pilot/response-parser.d.ts.map +1 -1
  64. package/dist/pilot/response-parser.js +228 -64
  65. package/dist/pilot/response-parser.js.map +1 -1
  66. package/dist/pilot/state.d.ts +1 -1
  67. package/dist/pilot/state.d.ts.map +1 -1
  68. package/dist/pilot/state.js +170 -38
  69. package/dist/pilot/state.js.map +1 -1
  70. package/dist/planner/plan-generator.d.ts +6 -0
  71. package/dist/planner/plan-generator.d.ts.map +1 -1
  72. package/dist/planner/plan-generator.js +26 -0
  73. package/dist/planner/plan-generator.js.map +1 -1
  74. package/dist/planner/plan-runner.d.ts +3 -1
  75. package/dist/planner/plan-runner.d.ts.map +1 -1
  76. package/dist/planner/plan-runner.js +170 -22
  77. package/dist/planner/plan-runner.js.map +1 -1
  78. package/dist/planner/plan-store.d.ts +6 -0
  79. package/dist/planner/plan-store.d.ts.map +1 -1
  80. package/dist/planner/plan-store.js +27 -0
  81. package/dist/planner/plan-store.js.map +1 -1
  82. package/dist/planner/plan-types.d.ts +18 -2
  83. package/dist/planner/plan-types.d.ts.map +1 -1
  84. package/dist/reporter/types.d.ts +19 -4
  85. package/dist/reporter/types.d.ts.map +1 -1
  86. package/dist/types.d.ts +3 -3
  87. package/dist/types.d.ts.map +1 -1
  88. package/dist/types.js +1 -1
  89. package/dist/types.js.map +1 -1
  90. package/package.json +4 -1
  91. package/dist/map/diagnose.d.ts +0 -7
  92. package/dist/map/diagnose.d.ts.map +0 -1
  93. package/dist/map/diagnose.js +0 -140
  94. package/dist/map/diagnose.js.map +0 -1
  95. package/dist/parser/steps.d.ts +0 -13
  96. package/dist/parser/steps.d.ts.map +0 -1
  97. package/dist/parser/steps.js +0 -44
  98. package/dist/parser/steps.js.map +0 -1
@@ -3,6 +3,8 @@
3
3
  * Iterates through test steps: capture state → LLM → execute → record result.
4
4
  */
5
5
  import { validatePlanReferences } from "./response-parser.js";
6
+ import { resolveDatePick } from "./datepick.js";
7
+ import { stepNeedsRandom, injectRandomValues, replaceWithPlaceholders } from "./random.js";
6
8
  import { capturePageState } from "./state.js";
7
9
  import { resetRefCounter } from "./a11y-parser.js";
8
10
  import { executeAction } from "./executor.js";
@@ -15,6 +17,15 @@ import { globals } from "../globals.js";
15
17
  export async function runTestCase(page, testCase, llm, options) {
16
18
  const startTime = performance.now();
17
19
  const stepResults = [];
20
+ /** Index of the queue entry currently being executed (set in the loop). */
21
+ let currentQueuePlanned = null;
22
+ const recordStep = (result) => {
23
+ stepResults.push(result);
24
+ if (result.status === "passed" && currentQueuePlanned?.inputStepIndex != null) {
25
+ lastCompletedInputStep = Math.max(lastCompletedInputStep, currentQueuePlanned.inputStepIndex);
26
+ }
27
+ options.onStepComplete?.(result);
28
+ };
18
29
  // Fresh conversation history, stable ref map, and value store for each test case
19
30
  llm.resetHistory();
20
31
  resetRefCounter();
@@ -69,11 +80,23 @@ export async function runTestCase(page, testCase, llm, options) {
69
80
  // Log the errors but don't fail — the LLM may have made a mistake
70
81
  // that the runtime can still handle
71
82
  }
83
+ if (globals.debug) {
84
+ console.log(`\n Input step mapping:`);
85
+ for (const p of plan) {
86
+ console.log(` [${String(p.inputStepIndex ?? "?")}] ${p.step}`);
87
+ }
88
+ }
72
89
  // Build the execution queue — EXPAND steps get expanded at runtime
73
90
  // and their sub-steps are spliced into the queue.
74
91
  const queue = [...plan];
75
92
  let queueIndex = 0;
76
93
  let failed = false;
94
+ let lastCompletedInputStep = -1;
95
+ // Track whether we're inside a DATEPICK expansion — sub-steps should
96
+ // not be individually recorded in the heuristic plan (the whole datepick
97
+ // will be re-expanded with fresh timestamps on cached replay).
98
+ let insideDatePick = false;
99
+ let datepickSubStepsRemaining = 0;
77
100
  // Map adapter — set by MAP_DETECT, then passed to all subsequent state captures
78
101
  let mapAdapter = null;
79
102
  // Latest captured map state — passed to assertions
@@ -81,7 +104,8 @@ export async function runTestCase(page, testCase, llm, options) {
81
104
  while (queueIndex < queue.length && !failed) {
82
105
  const planned = queue[queueIndex];
83
106
  queueIndex++;
84
- const { step, action: plannedAction, needsExpansion, needsMapDetect, rememberAs, compare: plannedCompare } = planned;
107
+ currentQueuePlanned = planned;
108
+ const { step, action: plannedAction, needsExpansion, needsDatePick, needsMapDetect, rememberAs, compare: plannedCompare } = planned;
85
109
  // ── MAP_DETECT: find and attach to a map instance ─────────────
86
110
  if (needsMapDetect) {
87
111
  trace.log("map:detect", step);
@@ -92,7 +116,7 @@ export async function runTestCase(page, testCase, llm, options) {
92
116
  }
93
117
  mapAdapter = await detectMap(page);
94
118
  if (!mapAdapter) {
95
- stepResults.push({
119
+ recordStep({
96
120
  step,
97
121
  action: null,
98
122
  status: "failed",
@@ -107,7 +131,7 @@ export async function runTestCase(page, testCase, llm, options) {
107
131
  if (recorder) {
108
132
  recorder.recordStep(step, { action: "map_detect" }, { success: true, duration: performance.now() - stepStart }, { url: page.url(), title: await page.title() });
109
133
  }
110
- stepResults.push({
134
+ recordStep({
111
135
  step,
112
136
  action: null,
113
137
  status: "passed",
@@ -116,7 +140,7 @@ export async function runTestCase(page, testCase, llm, options) {
116
140
  }
117
141
  }
118
142
  catch (err) {
119
- stepResults.push({
143
+ recordStep({
120
144
  step,
121
145
  action: null,
122
146
  status: "failed",
@@ -157,7 +181,7 @@ export async function runTestCase(page, testCase, llm, options) {
157
181
  queue.splice(queueIndex, 0, ...expandedSteps);
158
182
  }
159
183
  catch (err) {
160
- stepResults.push({
184
+ recordStep({
161
185
  step,
162
186
  action: null,
163
187
  status: "failed",
@@ -168,6 +192,104 @@ export async function runTestCase(page, testCase, llm, options) {
168
192
  }
169
193
  continue;
170
194
  }
195
+ // ── DATEPICK: resolve date/time picker with chrono-node ──────
196
+ if (needsDatePick) {
197
+ trace.log("datepick:start", step);
198
+ if (globals.debug) {
199
+ console.log(`\n Resolving date picker step: ${step}`);
200
+ }
201
+ if (options.waitForNetworkIdle) {
202
+ await options.waitForNetworkIdle();
203
+ }
204
+ const state = await capturePageState(page, options.consoleDrain, {
205
+ mapAdapter: mapAdapter ?? undefined,
206
+ });
207
+ // Ask the LLM which picker group to target (it can see the a11y tree).
208
+ // The step text is e.g. "set the end time to..." and the tree has groups
209
+ // like "Start date and time", "End date and time".
210
+ let groupHint;
211
+ try {
212
+ const groupStep = `Which date/time picker group on this page should be used for: "${step}"? Respond with ONLY the group name, nothing else.`;
213
+ const groupAction = await llm.resolveStep(groupStep, state);
214
+ // The LLM returns a text action — extract the group name from the value or text
215
+ groupHint = groupAction.value ?? groupAction.text;
216
+ if (globals.debug) {
217
+ console.log(` [datepick] LLM group hint: "${groupHint ?? "none"}"`);
218
+ }
219
+ }
220
+ catch {
221
+ // LLM couldn't help — fall through to fuzzy matching
222
+ }
223
+ try {
224
+ const t0 = performance.now();
225
+ const expandedSteps = resolveDatePick(step, state.a11yTree, groupHint);
226
+ const duration = performance.now() - t0;
227
+ trace.log("datepick:done", `${String(Math.round(duration))}ms → ${String(expandedSteps.length)} sub-steps`);
228
+ if (globals.debug) {
229
+ console.log(` Date picker resolved into ${String(expandedSteps.length)} sub-steps:`);
230
+ for (const es of expandedSteps) {
231
+ console.log(` - ${JSON.stringify(es.action)}`);
232
+ }
233
+ console.log();
234
+ }
235
+ // Record a single datepick marker in the heuristic plan.
236
+ // Sub-steps will NOT be individually recorded — the datepick
237
+ // will be re-resolved with fresh timestamps on cached replay.
238
+ if (recorder) {
239
+ recorder.recordStep(step, { action: "datepick", value: step, option: groupHint }, { success: true, duration }, { url: page.url(), title: await page.title() });
240
+ }
241
+ // Track how many sub-steps to skip recording for
242
+ insideDatePick = true;
243
+ datepickSubStepsRemaining = expandedSteps.length;
244
+ queue.splice(queueIndex, 0, ...expandedSteps);
245
+ }
246
+ catch (err) {
247
+ recordStep({
248
+ step,
249
+ action: null,
250
+ status: "failed",
251
+ duration: 0,
252
+ error: `Failed to resolve date picker: ${err instanceof Error ? err.message : String(err)}`,
253
+ });
254
+ failed = true;
255
+ }
256
+ continue;
257
+ }
258
+ // ── CONDITIONAL: evaluate condition and splice chosen branch ──
259
+ if (planned.condition) {
260
+ trace.log("condition:eval", `${planned.condition.type} "${planned.condition.target}"`);
261
+ const stepStart = performance.now();
262
+ if (options.waitForNetworkIdle) {
263
+ await options.waitForNetworkIdle();
264
+ }
265
+ // Capture page state and let the LLM evaluate the condition
266
+ const state = await capturePageState(page, options.consoleDrain, {
267
+ mapAdapter: mapAdapter ?? undefined,
268
+ });
269
+ const conditionMet = await llm.evaluateCondition(planned.condition.target, planned.condition.type, state);
270
+ trace.log("condition:result", String(conditionMet));
271
+ if (globals.debug) {
272
+ console.log(` Condition ${planned.condition.type} "${planned.condition.target}": ${String(conditionMet)}`);
273
+ }
274
+ const branch = conditionMet ? planned.thenBranch : planned.elseBranch;
275
+ const branchLabel = conditionMet ? "then" : (planned.elseBranch ? "else" : "skipped");
276
+ if (branch && branch.length > 0) {
277
+ // Splice the chosen branch into the queue at the current position
278
+ queue.splice(queueIndex, 0, ...branch);
279
+ }
280
+ // Record the conditional evaluation step
281
+ if (recorder) {
282
+ recorder.recordConditionalStep(step, planned.condition, conditionMet, branch);
283
+ }
284
+ recordStep({
285
+ step,
286
+ action: null,
287
+ status: "passed",
288
+ duration: performance.now() - stepStart,
289
+ conditionResult: { met: conditionMet, branch: branchLabel },
290
+ });
291
+ continue;
292
+ }
171
293
  // ── Normal step execution (same as before) ───────────────────
172
294
  trace.log("step:start", step);
173
295
  const stepStart = performance.now();
@@ -178,12 +300,38 @@ export async function runTestCase(page, testCase, llm, options) {
178
300
  execute: 0,
179
301
  postCapture: 0,
180
302
  };
303
+ // Inject random values into steps that mention "random"
304
+ let randomValues = null;
305
+ let resolveStep = step;
306
+ if (!plannedAction && stepNeedsRandom(step)) {
307
+ const injected = injectRandomValues(step);
308
+ resolveStep = injected.step;
309
+ randomValues = injected.values;
310
+ if (globals.debug) {
311
+ console.log(` [random] Injected: number="${randomValues.number}", string="${randomValues.string}"`);
312
+ console.log(` [random] Step prompt: ${resolveStep}`);
313
+ }
314
+ }
181
315
  try {
182
316
  let a11yTree = [];
183
317
  if (plannedAction) {
184
- // Pre-planned: skip page capture and LLM call
318
+ // Pre-planned: skip LLM call but capture page state if
319
+ // the action uses a ref (needed for locator resolution).
185
320
  action = plannedAction;
186
321
  trace.log("plan:hit", JSON.stringify(action));
322
+ if (action.ref) {
323
+ if (options.waitForNetworkIdle) {
324
+ await options.waitForNetworkIdle();
325
+ }
326
+ const t0 = performance.now();
327
+ const state = await capturePageState(page, options.consoleDrain, {
328
+ mapAdapter: mapAdapter ?? undefined,
329
+ });
330
+ timing.capture = performance.now() - t0;
331
+ a11yTree = state.a11yTree;
332
+ if (state.mapState)
333
+ latestMapState = state.mapState;
334
+ }
187
335
  }
188
336
  else {
189
337
  // Needs page state: wait for async requests to settle, then capture
@@ -199,7 +347,7 @@ export async function runTestCase(page, testCase, llm, options) {
199
347
  trace.log("capture:done", `${String(Math.round(timing.capture))}ms`);
200
348
  trace.log("llm:start");
201
349
  t0 = performance.now();
202
- action = await llm.resolveStep(step, state);
350
+ action = await llm.resolveStep(resolveStep, state);
203
351
  timing.llm = performance.now() - t0;
204
352
  trace.log("llm:done", `${String(Math.round(timing.llm))}ms → ${JSON.stringify(action)}`);
205
353
  a11yTree = state.a11yTree;
@@ -222,14 +370,16 @@ export async function runTestCase(page, testCase, llm, options) {
222
370
  }
223
371
  }
224
372
  // Propagate compare metadata from planned step to action.
225
- // The LLM resolves the element ref at runtime; we inject the
226
- // comparison operator and variable from the plan.
373
+ // The plan is authoritative for comparison logic always override
374
+ // whatever the runtime LLM may have generated (it doesn't know
375
+ // about literal values or the correct variable name).
227
376
  if (plannedCompare) {
228
- action.compare ??= {
377
+ action.compare = {
229
378
  variable: plannedCompare.variable,
230
379
  operator: plannedCompare.operator,
380
+ ...(plannedCompare.literal !== undefined ? { literal: plannedCompare.literal } : {}),
231
381
  };
232
- action.assertion ??= { type: "compare", expected: step };
382
+ action.assertion = { type: "compare", expected: step };
233
383
  action.action = "assert";
234
384
  }
235
385
  if (globals.debug) {
@@ -241,11 +391,11 @@ export async function runTestCase(page, testCase, llm, options) {
241
391
  const result = await executeAction(page, action, a11yTree, undefined, {
242
392
  state: latestMapState,
243
393
  adapter: mapAdapter ?? undefined,
244
- });
394
+ }, step);
245
395
  timing.execute = performance.now() - t0;
246
396
  trace.log("execute:done", `${String(Math.round(timing.execute))}ms ${result.success ? "ok" : `FAIL: ${result.error ?? ""}`}`);
247
397
  if (!result.success) {
248
- stepResults.push({
398
+ recordStep({
249
399
  step,
250
400
  action,
251
401
  status: "failed",
@@ -260,21 +410,29 @@ export async function runTestCase(page, testCase, llm, options) {
260
410
  if (result.rememberedValue !== undefined && action.rememberAs) {
261
411
  globals.valueStore.set(action.rememberAs, result.rememberedValue);
262
412
  }
413
+ // Wait for the page to stabilize after mutating actions
414
+ // (click, type, select, etc.) so the next step sees a settled page.
415
+ // Assertions don't mutate the page, so skip for those.
416
+ if (action.action !== "assert") {
417
+ await page.waitForLoadState("domcontentloaded");
418
+ if (options.waitForNetworkIdle) {
419
+ await options.waitForNetworkIdle();
420
+ }
421
+ }
263
422
  // Capture post-action screenshot for reporting
264
- // Retry once if the page is mid-navigation
265
423
  trace.log("postCapture:start");
266
424
  t0 = performance.now();
267
425
  let postState;
268
426
  try {
269
427
  postState = await capturePageState(page, options.consoleDrain, {
270
- screenshot: true,
428
+ screenshot: options.screenshots ?? false,
271
429
  mapAdapter: mapAdapter ?? undefined,
272
430
  });
273
431
  }
274
432
  catch {
275
433
  await page.waitForLoadState("domcontentloaded");
276
434
  postState = await capturePageState(page, options.consoleDrain, {
277
- screenshot: true,
435
+ screenshot: options.screenshots ?? false,
278
436
  mapAdapter: mapAdapter ?? undefined,
279
437
  });
280
438
  }
@@ -282,14 +440,21 @@ export async function runTestCase(page, testCase, llm, options) {
282
440
  trace.log("postCapture:done", `${String(Math.round(timing.postCapture))}ms`);
283
441
  if (postState.mapState)
284
442
  latestMapState = postState.mapState;
285
- // Record step for heuristic plan if recorder is active
286
- if (recorder) {
287
- recorder.recordStep(step, action, result, {
443
+ // Record step for heuristic plan if recorder is active.
444
+ // Skip for datepick sub-steps — the datepick marker was already
445
+ // recorded and will be re-expanded with fresh timestamps on replay.
446
+ if (recorder && !insideDatePick) {
447
+ // Replace random values with placeholders so cached runs
448
+ // generate fresh random values on replay.
449
+ const recordAction = randomValues && action.value
450
+ ? { ...action, value: replaceWithPlaceholders(action.value, randomValues) }
451
+ : action;
452
+ recorder.recordStep(step, recordAction, result, {
288
453
  url: postState.url,
289
454
  title: postState.title,
290
455
  });
291
456
  }
292
- stepResults.push({
457
+ recordStep({
293
458
  step,
294
459
  action,
295
460
  status: "passed",
@@ -297,6 +462,13 @@ export async function runTestCase(page, testCase, llm, options) {
297
462
  timing,
298
463
  screenshot: postState.screenshot,
299
464
  });
465
+ // Track datepick sub-step completion
466
+ if (insideDatePick) {
467
+ datepickSubStepsRemaining--;
468
+ if (datepickSubStepsRemaining <= 0) {
469
+ insideDatePick = false;
470
+ }
471
+ }
300
472
  }
301
473
  catch (err) {
302
474
  // LLM API errors (4xx/5xx) must abort the entire run — re-throw
@@ -304,7 +476,7 @@ export async function runTestCase(page, testCase, llm, options) {
304
476
  const { LLMApiError } = await import("./providers/index.js");
305
477
  if (err instanceof LLMApiError)
306
478
  throw err;
307
- stepResults.push({
479
+ recordStep({
308
480
  step,
309
481
  action,
310
482
  status: "failed",
@@ -322,6 +494,7 @@ export async function runTestCase(page, testCase, llm, options) {
322
494
  status,
323
495
  steps: stepResults,
324
496
  duration: performance.now() - startTime,
497
+ completedInputSteps: lastCompletedInputStep + 1,
325
498
  };
326
499
  }
327
500
  //# sourceMappingURL=pilot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pilot.js","sourceRoot":"","sources":["../../src/pilot/pilot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAavC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,IAAU,EACV,QAA2C,EAC3C,GAAc,EACd,OAAqB;IAErB,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAA;IACnC,MAAM,WAAW,GAAiB,EAAE,CAAA;IAEpC,iFAAiF;IACjF,GAAG,CAAC,YAAY,EAAE,CAAA;IAClB,eAAe,EAAE,CAAA;IACjB,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;IAE1B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAA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KAC/C,CAAA;AACF,CAAC"}
@@ -1,8 +1,43 @@
1
1
  /**
2
2
  * Prompt constants for the LLM client.
3
+ *
4
+ * There are three prompts, used at different stages of test execution:
5
+ *
6
+ * 1. PLAN_SYSTEM_PROMPT — converts the user's natural-language test steps
7
+ * into a flat list of actions at plan time (no page context).
8
+ *
9
+ * 2. SYSTEM_PROMPT — resolves a single step at runtime, with the
10
+ * live page state (a11y tree, visible text, map state). Used for steps
11
+ * the planner couldn't pre-resolve (PAGE, REMEMBER, COMPARE, etc.).
12
+ *
13
+ * 3. EXPAND_SYSTEM_PROMPT — decomposes a compound step (like "fill in
14
+ * the form") into atomic actions at runtime, given the form fields.
15
+ *
16
+ * ─── How to extend ───────────────────────────────────────────────────
17
+ *
18
+ * Adding a new ACTION (e.g. "drag"):
19
+ * • SYSTEM_PROMPT → add to "Interaction actions" + add a JSON example.
20
+ * • PLAN_PROMPT → add to "Runtime actions" + add an example if the
21
+ * planner can decide statically, otherwise PAGE covers it.
22
+ * • response-parser.ts → add to VALID_ACTIONS, handle any new fields.
23
+ * • executor.ts → implement the execution logic.
24
+ *
25
+ * Adding a new ASSERTION type (e.g. "element_count"):
26
+ * • SYSTEM_PROMPT → add to "Assertion types" + add a JSON example.
27
+ * • PLAN_PROMPT → add to "Static assertions" if pre-resolvable,
28
+ * or add a routing rule under "Assertion routing" if the planner
29
+ * should emit a specific action type for it.
30
+ * • assertions.ts → implement the check in buildAssertionCheck or
31
+ * as a dedicated function.
32
+ *
33
+ * Adding a new PLAN-ONLY action (e.g. "WAIT_FOR_DEPLOY"):
34
+ * • PLAN_PROMPT → add to "Plan-only actions".
35
+ * • response-parser.ts → add parsing in parsePlanAction.
36
+ * • pilot.ts → handle the new flag in the execution loop.
3
37
  */
4
38
  /** System prompt that defines the Pilot's persona and expected response format. */
5
- export declare const SYSTEM_PROMPT = "You are The Pilot, an AI agent that executes end-to-end tests in a web browser.\n\nYou receive a plain-English test step and the current page state.\n\nThe page state may be provided in different levels of detail:\n- Full state: complete accessibility tree + visible page text (first step and after navigation).\n- Tree diff: only the added/removed lines from the accessibility tree (when a small part of the page changed, e.g. a form wizard step). Combine this with the full tree from earlier in the conversation \u2014 unchanged elements keep the same refs.\n- Unchanged: the page is identical to the previous step.\n\nElement refs (e1, e2, ...) are STABLE within a test case \u2014 the same element always keeps the same ref across captures. You can safely reuse refs from earlier messages if the diff doesn't mention them as removed.\n\nYour job is to determine the SINGLE browser action needed to execute the step.\n\nAvailable actions:\n- click: Click an element. Requires \"ref\" or \"text\".\n- check: Check a checkbox. Requires \"ref\" or \"text\". Use this instead of click for checkboxes.\n- uncheck: Uncheck a checkbox. Requires \"ref\" or \"text\".\n- type: Type text into an input. Requires \"ref\" or \"text\", and \"value\".\n- select: Select an option from a dropdown. Requires \"ref\" or \"text\", and \"value\" (the option label).\n- autocomplete: Type into an autocomplete/typeahead field, wait for suggestions to appear, and click one. Requires \"ref\" or \"text\", \"value\" (the text to type), and optionally \"option\" (the suggestion to select \u2014 defaults to the first suggestion if omitted).\n- scroll: Scroll the page. Requires \"value\" (\"up\" or \"down\"). Optional \"ref\" to scroll a specific element.\n- navigate: Navigate to a URL. Requires \"value\" (the URL or path).\n- press: Press a keyboard key. Requires \"value\" (key name, e.g. \"Enter\", \"Tab\", \"Escape\").\n- wait: Wait for a condition. Requires \"value\" (description of what to wait for).\n- remember: Capture a value from the page for later comparison. Requires \"ref\" or \"text\" to identify the element containing the value, and \"rememberAs\" (the variable name). The runtime reads the textContent of the targeted element. IMPORTANT: Target the most specific element that contains the actual value \u2014 not a parent container, heading, or wrapper that includes unrelated text.\n- assert: Check a condition on the page. Requires \"assertion\" with \"type\" and \"expected\".\n Assertion types: \"contains_text\", \"not_contains_text\", \"url_contains\", \"element_visible\", \"element_not_visible\", \"element_exists\", \"link_exists\", \"field_exists\".\n Special type \"compare\": requires additional \"compare\" field with \"variable\" (remembered name) and \"operator\" (less_than, greater_than, equal, not_equal, less_or_equal, greater_or_equal). The \"expected\" field describes what current value to read from the page. Use \"ref\" to target the element containing the current value.\n Special type \"map_state\": asserts a condition about the map. Use ONLY when the step is about what the map shows, its zoom level, or its layers. The runtime queries the map's rendered features (place names, road names, etc.) and viewport state to evaluate the assertion. The \"expected\" field should describe the condition clearly:\n - For locations/places: \"map shows \u00D6rebro\" or \"map shows \"\u00D6rebro\"\" \u2014 the runtime searches all rendered features for a name match.\n - For zoom: \"zoom level is at least 10\"\n - For layers: \"layer hospitals is visible\"\n NEVER use \"contains_text\" for map-related assertions \u2014 the map is a WebGL canvas and its content is not in the DOM text.\n\nElement targeting:\n- Use \"ref\" when the target element appears in the accessibility tree (preferred).\n- Use \"text\" when the target is NOT in the accessibility tree but is visible on the page. The text value should match the visible text of the element you want to interact with. This is common when page markup lacks proper ARIA roles.\n- Never guess a ref. If the element you need is not in the tree, use \"text\" instead.\n- A \"Visible page text\" section shows what a human actually sees on the page. Use it to find elements that are missing from the accessibility tree \u2014 target them with \"text\" matching their visible label.\n\nMap state: When a map is detected on the page, an additional \"Map state\" section is included in the page state showing center coordinates, zoom level, bearing, pitch, bounds, and visible layers. For ANY step that refers to the map's geographic position, zoom, what area the map shows, or what location is visible on the map, you MUST use assertion type \"map_state\" \u2014 NEVER \"contains_text\". The map is a WebGL canvas; its rendered content (tiles, markers, labels) does NOT appear in the DOM text or accessibility tree.\n\nIMPORTANT: Any step that starts with \"check that\" is ALWAYS an assertion. Never return a click, type, or other interaction for a \"check that\" step.\n\nIMPORTANT: When the step description contains a word or phrase in quotes (e.g. the \"resultat\" count, the \"Total\" badge), the target element MUST contain that exact quoted text. Use this as a strict filter when choosing which element to target \u2014 do not pick an element that lacks the quoted keyword in its visible text.\n\nRespond with ONLY a JSON object. No markdown, no explanation. Example responses:\n\n{\"action\":\"click\",\"ref\":\"e5\"}\n{\"action\":\"click\",\"text\":\"About us\"}\n{\"action\":\"type\",\"ref\":\"e3\",\"value\":\"jane@example.com\"}\n{\"action\":\"select\",\"ref\":\"e8\",\"value\":\"Canada\"}\n{\"action\":\"autocomplete\",\"ref\":\"e4\",\"value\":\"foo\"}\n{\"action\":\"autocomplete\",\"ref\":\"e4\",\"value\":\"foo\",\"option\":\"foobar inc\"}\n{\"action\":\"check\",\"ref\":\"e12\"}\n{\"action\":\"navigate\",\"value\":\"/products\"}\n{\"action\":\"press\",\"value\":\"Enter\"}\n{\"action\":\"remember\",\"ref\":\"e15\",\"rememberAs\":\"product_count\"}\n{\"action\":\"assert\",\"assertion\":{\"type\":\"compare\",\"expected\":\"product count\"},\"compare\":{\"variable\":\"product_count\",\"operator\":\"less_than\"},\"ref\":\"e15\"}\n{\"action\":\"assert\",\"assertion\":{\"type\":\"contains_text\",\"expected\":\"Welcome back\"}}\n{\"action\":\"assert\",\"assertion\":{\"type\":\"map_state\",\"expected\":\"map shows \"\u00D6rebro\"\"}}\n{\"action\":\"assert\",\"assertion\":{\"type\":\"map_state\",\"expected\":\"zoom level is at least 10\"}}\n{\"action\":\"assert\",\"assertion\":{\"type\":\"map_state\",\"expected\":\"map shows \"Stockholm\"\"}}\n{\"action\":\"scroll\",\"value\":\"down\"}\n";
6
- export declare const PLAN_SYSTEM_PROMPT = "We are processing a test description for an automated E2E testing tool.\n\nIt has a list of test steps in natural language that you should convert into actions using a simple line-based format. Output one line per action. A single input step may produce multiple output lines if it describes a sequence of actions.\n\nAction syntax (one per line):\n- PAGE \"description\" \u2014 needs the live page to resolve (click, type, select interactions). The description should be a clear, atomic instruction.\n- MAP_DETECT \u2014 detect and attach to an interactive map on the page (MapLibre GL, Mapbox GL, Leaflet, etc.). This MUST appear before any map-related steps. It fails if no supported map is found. Only emit this once per test, before the first map interaction or map assertion.\n- EXPAND \"description\" \u2014 a compound step that requires seeing the live page to decompose into multiple actions. Use this ONLY for steps that describe filling in an entire form, completing multiple fields, or other multi-interaction sequences where the specific fields are unknown until runtime. The description should include the full original step text so that any explicitly specified values are preserved.\n- REMEMBER \"what to capture from the page\" as \"variable_name\" \u2014 captures a value from the page for later comparison. The description tells the runtime what to extract (e.g. \"the number of products shown\", \"the total price\", \"the item count badge text\"). The variable name is a short identifier.\n- COMPARE \"what to read now\" \"operator\" remembered \"variable_name\" \u2014 compares a current page value against a previously remembered value. Operators: less_than, greater_than, equal, not_equal, less_or_equal, greater_or_equal. The first description tells the runtime what current value to read.\n- assert contains_text \"text\"\n- assert not_contains_text \"text\"\n- assert url_contains \"text\"\n- assert element_visible \"text\"\n- assert element_not_visible \"text\"\n- assert link_exists \"href\"\n- assert field_exists \"label\"\n- navigate \"url\" \u2014 ONLY for explicit URLs or paths starting with \"/\" or \"http\". Example: navigate \"/about\", navigate \"https://example.com\". Do NOT use navigate for steps like \"go to the About page\" or \"navigate to Contact from menu\" \u2014 those describe clicking a link or menu item and should be PAGE instead.\n- press \"key\"\n- scroll \"up|down\"\n\nRules:\n- Any step that says \"check that\" or \"verify\" or similar language is ALWAYS an assertion.\n- Assertions with explicit quoted strings (e.g. check that the page contains \"Welcome\") can be resolved as literal assertions: assert contains_text \"Welcome\"\n- Assertions WITHOUT quoted strings describe something conceptual (e.g. \"check that the page contains a Leads form\", \"check that there is a contact section\"). These CANNOT be pre-resolved because the actual page text may differ from the description. Output PAGE with the full step as description so the runtime LLM can inspect the page.\n- For assertions that CAN be resolved, preserve the FULL expected text exactly as written. Never truncate or shorten it.\n- Steps that require seeing the page to identify interactive elements \u2192 PAGE with a description.\n- References to earlier steps: When a step uses pronouns or references like \"that form\", \"the same page\", \"this dropdown\", resolve them using context from earlier steps. Replace the reference with the concrete name from the earlier step. For example, if step 6 says 'check that the page contains a \"Vad beh\u00F6ver du hj\u00E4lp med?\" form' and step 7 says 'Select F\u00F6retag in that form', resolve \"that form\" to the \"Vad beh\u00F6ver du hj\u00E4lp med?\" form.\n- IMPORTANT: Each output line must describe exactly ONE atomic interaction (one click, one type, one select). If an input step describes or implies multiple interactions \u2014 whether separated by dashes, commas, slashes, \"then\", \"and\", or simply listing several values/items/choices \u2014 split it into one PAGE line per interaction. Always err on the side of splitting: if a step could be multiple actions, it IS multiple actions.\n- When a step lists multiple values separated by dashes (e.g. \"Select A - B - C in the form\"), these are sequential CLICKS on buttons or tabs \u2014 NOT dropdown selections. Split into separate click steps. Use \"click\" in the description, not \"select\".\n- When splitting a step into multiple actions, PRESERVE the full original context in each sub-step description. The runtime LLM will see each sub-step independently without knowledge of the others, so each description must be self-contained and unambiguous. Include enough detail to identify the correct element (e.g. mention the form name, section, or UI context).\n For example:\n Input: \"Select Category - Subcategory - Option in the filter form\" \u2192 three lines:\n PAGE \"click the 'Category' button/tab in the filter form (first selection in the sequence Category - Subcategory - Option)\"\n PAGE \"click 'Subcategory' in the filter form (second selection after Category was selected)\"\n PAGE \"click 'Option' in the filter form (third selection after Category and Subcategory were selected)\"\n Input: \"Fill in name, email and phone\" \u2192 three lines:\n PAGE \"fill in the name field\"\n PAGE \"fill in the email field\"\n PAGE \"fill in the phone field\"\n- EXCEPTION: Selecting a value from a dropdown or filter is ALWAYS a single PAGE step. Do NOT split \"select X in Y\" into \"open Y\" + \"select X\" \u2014 the runtime handles opening and selecting atomically. Example:\n Input: \"select Elektriker in V\u00E4lj tj\u00E4nst\" \u2192 one line:\n PAGE \"select 'Elektriker' in 'V\u00E4lj tj\u00E4nst'\"\n Input: \"choose Red from the color dropdown\" \u2192 one line:\n PAGE \"select 'Red' from the color dropdown\"\n- EXCEPTION: If a step describes filling in an entire form without listing specific fields\n (e.g. \"fill in the form with some test data and submit it\", \"complete the contact form with email foo@bar.com\"),\n use a single EXPAND line instead of splitting. EXPAND means the runtime will inspect the actual form fields on the page\n and generate appropriate actions. Include the full original text so any explicit values are preserved.\n For example:\n Input: \"fill in the form with some test data and submit it\" \u2192 one line:\n EXPAND \"fill in the form with some test data and submit it\"\n Input: \"fill in the form with email foo@example.com and some test data\" \u2192 one line:\n EXPAND \"fill in the form with email foo@example.com and some test data\"\n- REMEMBER/COMPARE: When a step describes saving, noting, or remembering a value for later comparison, output a REMEMBER line. The REMEMBER line MUST always have the format: REMEMBER \"description\" as \"variable_name\" \u2014 both parts are required. Choose a short, descriptive variable name based on what is being captured.\n When a step describes comparing a current value against a previously saved one (e.g. \"check that X is less than before\", \"verify the count decreased\"), output a COMPARE line. The COMPARE MUST reference the exact variable name used in the earlier REMEMBER.\n Any language implying \"before vs after\" comparison requires a REMEMBER before the action and a COMPARE after.\n For example:\n Input: \"note the number of search results\" \u2192 REMEMBER \"the number of search results\" as \"result_count\"\n Input: \"check that the number of results is less than before filtering\" \u2192 COMPARE \"the number of search results\" \"less_than\" remembered \"result_count\"\n Input: \"remember the total price\" \u2192 REMEMBER \"the total price shown\" as \"total_price\"\n Input: \"verify the price didn't change\" \u2192 COMPARE \"the total price shown\" \"equal\" remembered \"total_price\"\n Input: \"remember the number of search results\" \u2192 REMEMBER \"the number of search results\" as \"search_result_count\"\n Input: \"check that the search results count has decreased\" \u2192 COMPARE \"the number of search results\" \"less_than\" remembered \"search_result_count\"\n- MAP DETECTION: If ANY step in the test mentions a map, map markers, map layers, zooming/panning a map, map coordinates, geographic features on a map, or any other map-related interaction or assertion, you MUST emit a MAP_DETECT line BEFORE the first such step. This initializes map support for the test. Only emit MAP_DETECT once. Examples of map-related language: \"map\", \"marker\", \"pin\", \"layer\", \"zoom level\", \"pan to\", \"coordinates\", \"center of the map\", \"map shows\", \"visible on the map\".\n- MAP ASSERTIONS: Any assertion about what the map shows, displays, or contains (e.g. \"check that the map shows X\", \"verify X is visible on the map\") MUST be output as PAGE, NOT as a pre-resolved assert. The map is a WebGL canvas \u2014 its content is NOT in the DOM text. These assertions require the runtime to query the map's rendered features, which can only happen at execution time with live page state. NEVER use \"assert contains_text\" for map content.\n- No blank lines, no numbering, no explanation. Only action lines.\n";
7
- export declare const EXPAND_SYSTEM_PROMPT = "You are expanding a high-level test step into concrete atomic actions based on the actual form fields visible on the page.\n\nYou receive:\n1. The original step instruction (which may specify some values explicitly and leave others to your judgement).\n2. The accessibility tree of the current page (with element refs).\n3. A detailed list of form fields with their label, placeholder, input type, required status, and available options.\n\nYour job is to produce one action line per interaction needed to fulfill the step. Use the same line-based format:\n- PAGE \"type <value> into the <field label/placeholder> field\" \u2014 for regular text input fields. Always reference the field by its label or placeholder as shown in the form fields list.\n- PAGE \"type <value> into the <field label/placeholder> autocomplete field and select the first suggestion\" \u2014 for fields marked [autocomplete]. This tells the runtime to type, wait for the dropdown, and click the first option.\n- PAGE \"type <value> into the <field label/placeholder> autocomplete field and select <specific option>\" \u2014 when the step specifies a particular option to pick from the autocomplete suggestions.\n- PAGE \"select <option> in the <field label> dropdown\" \u2014 for select fields.\n- PAGE \"check the <label> checkbox\" \u2014 for checkboxes.\n- PAGE \"click the <button text> button\" \u2014 for submit or other buttons.\n- press \"Enter\" \u2014 if the form should be submitted via Enter key.\n\nRules for autocomplete fields (marked [autocomplete] in the field list):\n- These are typeahead/combobox fields that show a dropdown of suggestions as the user types.\n- ALWAYS use the \"autocomplete field\" phrasing so the runtime knows to wait for and interact with the dropdown.\n- By default, select the first suggestion unless the step explicitly names a different choice.\n- Type a short search term that is likely to produce relevant results (e.g. first few characters of an expected value).\n\nRules for choosing test data:\n- If the step explicitly provides a value for a field (e.g. \"with email foo@example.com\"), use that EXACT value for the matching field. Match by field purpose \u2014 the step may say \"email\" while the field label says \"E-post\" or \"Mail address\".\n- For fields NOT explicitly specified, generate realistic fake test data appropriate for the field. Use the field's label, placeholder, and input type to determine what kind of data to generate:\n - Use the input type attribute (email, tel, url, number, etc.) to pick the right format.\n - Read the label and placeholder text (in whatever language they are written) to understand what the field expects, then generate a plausible value.\n - For free-text or message fields, use a short generic test string like \"Test message\".\n- For select/dropdown fields: pick the first non-empty option unless the step specifies a value.\n- For checkbox fields: check them if it sounds like it is needed. This includes consent checkboxes such as terms of service, privacy policy, data processing agreements, cookie consent, or similar \u2014 these must be checked for the form submission to succeed.\n- For required fields: always include them.\n- For optional fields: include them too (fill the whole form).\n- If the step says \"submit\" or similar, include a click on the submit button as the last action.\n\nOutput ONLY action lines, one per line. No blank lines, no numbering, no explanation.\n";
39
+ export declare const SYSTEM_PROMPT = "You are The Pilot, an AI agent that executes end-to-end tests in a web browser.\n\nYou receive a plain-English test step and the current page state.\nYour job is to determine the SINGLE browser action needed to execute the step.\nRespond with ONLY a single action line in the text format described below. No markdown, no explanation, no JSON.\n\n\u2550\u2550\u2550 Page state \u2550\u2550\u2550\n\nThe page state may be provided in different levels of detail:\n- Full state: complete accessibility tree with enrichment data (first step and after navigation).\n- Tree diff: only the added/removed lines from the accessibility tree (when a small part of the page changed, e.g. a form wizard step). Combine this with the full tree from earlier in the conversation \u2014 unchanged elements keep the same refs.\n- Unchanged: the page is identical to the previous step.\n\nElement refs (e1, e2, ...) are STABLE within a test case \u2014 the same element always keeps the same ref across captures. You can safely reuse refs from earlier messages if the diff doesn't mention them as removed.\n\nEach element in the tree may include enrichment properties indented below it:\n- \"text\": the visible text content (only shown when different from the element's a11y name)\n- \"placeholder\": the placeholder attribute (for inputs)\n- \"value\": the current input value or selected option\n\nExample:\n[e2] textbox \"Enter visitor password\"\n placeholder: \"Enter visitor password\"\n[e3] button \"Unlock\"\n text: \"Unlock\"\n[e14] textbox \"Email Address\"\n value: \"jane@example.com\"\n\n\u2550\u2550\u2550 Element targeting \u2550\u2550\u2550\n\n- ALWAYS use \"ref\" to target elements. The enriched accessibility tree shows each element's identity (role + name), visible text, placeholder, and value \u2014 use these to match the step description to the right element.\n- Use \"text\" ONLY as a last resort when the element is genuinely not in the accessibility tree. This is rare.\n- Never guess a ref. If you cannot confidently identify the element in the tree, use \"text\".\n- Use enrichment data to match fuzzy descriptions: if the step says \"password field\", match it to a textbox with placeholder \"Enter visitor password\".\n- When the step contains a word or phrase in quotes (e.g. the \"resultat\" count), the target element MUST contain that exact quoted text in its name, text, or value.\n\n\u2550\u2550\u2550 Interaction actions \u2550\u2550\u2550\n\n- click: Click an element. Requires \"ref\" or \"text\".\n- check / uncheck: Toggle a checkbox. Requires \"ref\" or \"text\". Use instead of click for checkboxes.\n- type: Type text into an input. Requires \"ref\" or \"text\", and \"value\". \n When the step means to type \"a string\", \"some test data\", or similar, generate realistic values yourself \n that matches the field name and use it as the value. If the step literally says \"random string\" or \"random number\"\n make up a fully random string or integer number that does not need to match the field name.\n- For date/time inputs: when the step uses relative time expressions like \"now plus 1 hour\", \"tomorrow\", or \"next week\",\n compute the actual date/time value from the current time provided in the page state. \n Format dates as the input expects (check the placeholder or input type \u2014 common formats: \n \"YYYY-MM-DD\", \"YYYY-MM-DDTHH:mm\", \"MM/DD/YYYY\", \"DD/MM/YYYY\"). \n- select: Select a dropdown option. Requires \"ref\" or \"text\", and \"value\" (the option label).\n- autocomplete: Type into an autocomplete field, wait for suggestions, click one. Requires \"ref\" or \"text\", \"value\" (text to type), optionally \"option\" (suggestion to select \u2014 defaults to first).\n- scroll: Scroll the page. Requires \"value\" (\"up\" or \"down\"). Optional \"ref\" to scroll a specific element.\n- navigate: Go to a URL. Requires \"value\" (the URL or path).\n- press: Press a key. Requires \"value\" (e.g. \"Enter\", \"Tab\", \"Escape\").\n- wait: Wait for a condition. Requires \"value\" (description of what to wait for).\n- remember: Capture a value from the page. Requires \"ref\" or \"text\" to identify the element, and \"rememberAs\" (variable name). \n IMPORTANT: Target the most specific element containing the value \u2014 not a parent or wrapper.\n\n\u2550\u2550\u2550 Assertion actions \u2550\u2550\u2550\n\nAny step starting with \"check that\" is ALWAYS an assertion \u2014 never return an interaction.\n\nassert: Requires \"assertion\" with \"type\" and \"expected\".\n\nAssertion types:\n- contains_text / not_contains_text \u2014 check page body text.\n- url_contains \u2014 check the current URL.\n- element_visible / element_not_visible \u2014 check element visibility.\n- element_disabled / element_enabled \u2014 check if a button is disabled or enabled.\n- element_exists / link_exists / field_exists \u2014 check element presence.\n- compare \u2014 numeric comparison. Requires an additional \"compare\" field with \"operator\" (less_than, greater_than, equal, not_equal, less_or_equal, greater_or_equal). Use \"ref\" to target the element containing the current value.\n Two modes:\n (a) Against a remembered variable: set \"variable\" to the variable name.\n (b) Against a literal number: set \"literal\" to the number and \"variable\" to \"_\". Use this when the step compares against a fixed number (0, 5, 10) \u2014 NOT a previously remembered value.\n- map_state \u2014 assert a condition about the map (see Map section below).\n\n\u2550\u2550\u2550 Map \u2550\u2550\u2550\n\nWhen a map is detected, the page state includes a \"Map state\" section with center, zoom, bearing, pitch, bounds, and layers.\n\nFor ANY step about the map's position, zoom, area, or content, use assertion type \"map_state\" \u2014 NEVER \"contains_text\". The map is a WebGL canvas; its content does NOT appear in the DOM.\n\nmap_state \"expected\" examples:\n- \"map shows <cityname>\" or \"map shows \\\"<cityname>\\\"\" \u2014 searches rendered features.\n- \"zoom level is at least 10\"\n- \"layer hospitals is visible\"\n\n\u2550\u2550\u2550 Response format \u2550\u2550\u2550\n\nOne line. Format: ACTION [ref=REF] [text=\"TEXT\"] [value=\"VALUE\"] [option=\"OPTION\"] [as=\"VAR\"]\n\nFor assertions: assert TYPE \"EXPECTED\" [ref=REF] [variable=\"VAR\" operator=\"OP\"] [literal=\"N\"]\n\n\u2550\u2550\u2550 Examples \u2550\u2550\u2550\n\nclick ref=e5\nclick text=\"About us\"\ntype ref=e3 value=\"jane@example.com\"\nselect ref=e8 value=\"Canada\"\nautocomplete ref=e4 value=\"foo\"\nautocomplete ref=e4 value=\"foo\" option=\"foobar inc\"\ncheck ref=e12\nuncheck ref=e12\nnavigate value=\"/products\"\npress value=\"Enter\"\nscroll value=\"down\"\nremember ref=e15 as=\"product_count\"\nassert contains_text \"Welcome back\"\nassert element_visible \"Submit\"\nassert element_not_visible \"Error\"\nassert element_disabled \"Submit\"\nassert element_enabled \"Submit\"\nassert url_contains \"/products\"\nassert compare \"product count\" ref=e15 variable=\"product_count\" operator=\"less_than\"\nassert compare \"product count\" ref=e15 variable=\"_\" operator=\"greater_than\" literal=\"0\"\nassert map_state \"map shows Stockholm\"\n";
40
+ export declare const PLAN_SYSTEM_PROMPT = "You are converting natural-language E2E test steps into a line-based action format. Output one line per action. A single input step may produce multiple output lines.\n\nIMPORTANT: Prefix every output line with the input step number it came from, using the format \"#N \" (e.g. \"#1 \", \"#2 \"). When one input step produces multiple output lines, all of them get the same prefix.\n\n\u2550\u2550\u2550 Action syntax (one per line) \u2550\u2550\u2550\n\n- PAGE \"description\" \u2014 needs the live page to resolve (click, type, select interactions). The description should be a clear, atomic instruction.\n- EXPAND \"description\" \u2014 a compound step that requires seeing the live page to decompose into multiple actions. Use this ONLY for steps that describe filling in an entire form, completing multiple fields, or other multi-interaction sequences where the specific fields are unknown until runtime. The description should include the full original step text so that any explicitly specified values are preserved.\n- DATEPICK \"description\" \"time expression\" \u2014 a step that sets a date, time, or datetime value in a picker widget. Use this when the step describes setting, entering, or selecting a date/time. \n The first string is the full step description. The second string is ONLY the time expression to parse (e.g. \"10 minutes from now\", \"tomorrow at 3pm\", \"2026-06-15 14:30\"). \n The runtime parses the time expression and inspects the actual picker structure automatically.\n Examples:\n \"set the start time to 10 minutes from now\" \u2192 DATEPICK \"set the start time to 10 minutes from now\" \"10 minutes from now\"\n \"set the end date to tomorrow\" \u2192 DATEPICK \"set the end date to tomorrow\" \"tomorrow\"\n \"enter 2026-06-15 in the date field\" \u2192 DATEPICK \"enter 2026-06-15 in the date field\" \"2026-06-15\"\n- REMEMBER \"what to capture from the page\" as \"variable_name\" \u2014 captures a value from the page for later comparison. The description tells the runtime what to extract. The variable name is a short identifier.\n- COMPARE \"what to read now\" \"operator\" remembered \"variable_name\" \u2014 compares a current page value against a previously remembered value. Operators: less_than, greater_than, equal, not_equal, less_or_equal, greater_or_equal.\n- ASSERT_REMEMBERED \"variable_name\" \u2014 asserts that the text stored in a previously remembered variable is visible on the page. Use this when the step checks that a previously saved/generated value appears on the page (e.g. \"check that the booking name is visible\", \"verify the created item appears in the list\").\n- MAP_DETECT \u2014 detect and attach to an interactive map. Must appear once, before any map step.\n- assert contains_text \"text\"\n- assert not_contains_text \"text\"\n- assert url_contains \"text\"\n- assert element_visible \"text\"\n- assert element_not_visible \"text\"\n- assert element_disabled \"button text\"\n- assert element_enabled \"button text\"\n- assert link_exists \"href\"\n- assert field_exists \"label\"\n- assert numeric \"text\" \u2014 asserts that a count, number, or quantity on the page satisfies a numeric comparison. Use when the step compares a value against a specific number (e.g. \"greater than 0\", \"at least 5\", \"equals 10\"). The runtime extracts the operator and number from the text.\n- navigate \"url\" \u2014 ONLY for explicit URLs or paths starting with \"/\" or \"http\". Do NOT use for steps like \"go to the About page\" \u2014 those describe clicking a link and should be PAGE instead.\n- press \"key\"\n- scroll \"up|down\"\n\n\u2550\u2550\u2550 Splitting steps \u2550\u2550\u2550\n\nEach output line = ONE atomic interaction. If a step implies multiple interactions, split it.\n\nRules:\n- Any step that says \"check that\" or \"verify\" or similar language is ALWAYS an assertion.\n- Assertions with explicit quoted strings (e.g. check that the page contains \"Welcome\") can be resolved as literal assertions: assert contains_text \"Welcome\"\n- Assertions that compare a count/number/quantity against a specific number (e.g. \"check that the count of products is greater than 0\", \"verify there are at least 5 items\") \u2192 assert numeric with the full step text. The runtime extracts the comparison from the text.\n- Assertions about a button being disabled or enabled with a quoted button name \u2192 assert element_disabled / assert element_enabled with the button text.\n- Assertions that compare against a previously remembered value (e.g. \"check that the count decreased\", \"verify the price is less than before\") \u2192 COMPARE with a matching REMEMBER.\n- Assertions WITHOUT quoted strings and without numeric comparisons describe something conceptual (e.g. \"check that the page contains a Leads form\"). These CANNOT be pre-resolved. Output PAGE with the full step as description.\n- A pure assertion = a single output line. Do NOT split \"check that the drawer opens and contains 'Hello'\" \u2014 the assert covers it.\n \"Verify that the drawer opens and contains the text \\\"Hello\\\"\" \u2192 assert contains_text \"Hello\"\n- BUT when a step combines an assertion AND an interaction (e.g. \"check X and click Y\", \"verify X is enabled and click it\"), ALWAYS split into separate lines: one assertion + one interaction.\n \"check that there is a dialog and click 'Yes'\" \u2192 two lines:\n PAGE \"check that there is a dialog\"\n PAGE \"click 'Yes'\"\n \"check that the 'Cancel' button is enabled and click it\" \u2192 two lines:\n assert element_enabled \"Cancel\"\n PAGE \"click 'Cancel'\"\n- For assertions that CAN be resolved, preserve the FULL expected text exactly as written. Never truncate or shorten it.\n- Steps that require seeing the page to identify interactive elements \u2192 PAGE with a description.\n- References to earlier steps: When a step uses pronouns like \"that form\", resolve them using context from earlier steps.\n- IMPORTANT: Each output line must describe exactly ONE atomic interaction. If an input step describes or implies multiple interactions \u2014 whether separated by dashes, commas, slashes, \"then\", \"and\", or simply listing several values \u2014 split it into one PAGE line per interaction. Always err on the side of splitting.\n- When a step lists multiple values separated by dashes (e.g. \"Select A - B - C in the form\"), these are sequential CLICKS on buttons or tabs \u2014 NOT dropdown selections. Split into separate click steps. Use \"click\" in the description, not \"select\".\n- When splitting, PRESERVE the full original context in each sub-step description. The runtime LLM will see each sub-step independently without knowledge of the others, so each description must be self-contained and unambiguous.\n For example:\n Input: \"Select Category - Subcategory - Option in the filter form\" \u2192 three lines:\n PAGE \"click 'Category' in the filter form (first selection in the sequence Category - Subcategory - Option)\"\n PAGE \"click 'Subcategory' in the filter form (second selection after Category was selected)\"\n PAGE \"click 'Option' in the filter form (third selection after Category and Subcategory were selected)\"\n- EXCEPTION: Selecting a SINGLE value from a dropdown is ALWAYS a single PAGE step. Do NOT split \"select X in Y\" into \"open Y\" + \"select X\" \u2014 the runtime handles opening and selecting atomically.\n- EXCEPTION: If a step describes filling in an entire form without listing specific fields, use a single EXPAND line.\n- DATE/TIME PICKERS: Any step that sets, enters, or selects a date or time value \u2192 DATEPICK. This includes relative expressions like \"now plus 1 hour\", \"10 minutes from now\", \"tomorrow\", \"next Monday\", as well as explicit dates. Examples:\n \"set the start time to 10 minutes from now\" \u2192 DATEPICK \"set the start time to 10 minutes from now\"\n \"set the end date to tomorrow\" \u2192 DATEPICK \"set the end date to tomorrow\"\n \"enter 2026-06-15 in the date field\" \u2192 DATEPICK \"enter 2026-06-15 in the date field\"\n- REMEMBER/COMPARE: When a step says to save/note/remember a value \u2192 REMEMBER. When a later step compares against it \u2192 COMPARE. Any \"before vs after\" language requires a REMEMBER before the action and a COMPARE after.\n- MAP DETECTION: If ANY step mentions a map, markers, layers, zoom, pan, coordinates, or geographic features, emit MAP_DETECT before the first such step. Only emit it once.\n- MAP ASSERTIONS: Any assertion about map content must be PAGE (map is WebGL canvas, content not in DOM).\n- CONDITIONAL STEPS: When a step contains \"if\" + a condition + an action (or uses a suffix like \"click X if visible\"), emit a conditional line. The format is:\n IF_VISIBLE \"element text or description\" THEN <action> [ELSE <action>]\n IF_CONTAINS \"text\" THEN <action> [ELSE <action>]\n IF_URL \"path or text\" THEN <action> [ELSE <action>]\n The THEN and ELSE parts use the same action syntax as regular steps (PAGE, assert, navigate, etc.).\n The ELSE part is optional \u2014 if omitted and the condition is false, the step is skipped.\n When a conditional step implies multiple actions under the same condition, emit multiple IF_ lines with the EXACT SAME condition text. Do NOT change the condition target between lines \u2014 the runtime evaluates each one independently.\n The condition target should use the exact text visible on the page when possible (button labels, link text, field placeholders). When the step describes a UI element generically (e.g. \"a password field\"), use the specific text that would appear on the page.\n Examples:\n \"if 'Accept cookies' is visible, click it\" \u2192 IF_VISIBLE \"Accept cookies\" THEN PAGE \"click 'Accept cookies'\"\n \"if the page shows 'Out of stock' then click 'Notify me' else click 'Add to cart'\" \u2192 IF_CONTAINS \"Out of stock\" THEN PAGE \"click 'Notify me'\" ELSE PAGE \"click 'Add to cart'\"\n \"click 'Dismiss' if visible\" \u2192 IF_VISIBLE \"Dismiss\" THEN PAGE \"click 'Dismiss'\"\n \"if url contains '/login' then check that page contains 'Sign in'\" \u2192 IF_URL \"/login\" THEN assert contains_text \"Sign in\"\n \"if there is a password field, fill it with 'secret' and press unlock\" \u2192\n IF_VISIBLE \"password\" THEN PAGE \"type 'secret' into the password field\"\n IF_VISIBLE \"password\" THEN PAGE \"click the unlock button\"\n- No blank lines, no numbering, no explanation. Only action lines.\n\nExamples:\n \"check that the count of products shown is greater than 0\" \u2192 assert numeric \"check that the count of products shown is greater than 0\"\n \"verify there are at least 5 results\" \u2192 assert numeric \"verify there are at least 5 results\"\n \"check that the page contains \\\"Welcome\\\"\" \u2192 assert contains_text \"Welcome\"\n \"Verify the drawer opens and contains \\\"Hello\\\"\" \u2192 assert contains_text \"Hello\"\n \"verify that the \\\"Submit\\\" button is disabled\" \u2192 assert element_disabled \"Submit\"\n \"verify that the \\\"Submit\\\" button is enabled\" \u2192 assert element_enabled \"Submit\"\n \"remember the total price\" \u2192 REMEMBER \"the total price shown\" as \"total_price\"\n \"check that the price decreased\" \u2192 COMPARE \"the total price shown\" \"less_than\" remembered \"total_price\"\n \"remember the name of the booking\" \u2192 REMEMBER \"the booking name\" as \"booking_name\"\n \"check that the booking we just created is visible\" \u2192 ASSERT_REMEMBERED \"booking_name\"\n";
41
+ export declare const EXPAND_SYSTEM_PROMPT = "You are expanding a high-level test step into concrete atomic actions based on the actual form fields visible on the page.\n\nYou receive:\n1. The original step instruction (which may specify some values explicitly).\n2. The accessibility tree of the current page (with element refs).\n3. A detailed list of form fields with label, placeholder, input type, required status, and options.\n\n\u2550\u2550\u2550 Action syntax \u2550\u2550\u2550\n\nOne line per interaction:\n- PAGE \"type <value> into the <field label> field\"\n- PAGE \"type <value> into the <field label> autocomplete field and select the first suggestion\"\n- PAGE \"type <value> into the <field label> autocomplete field and select <specific option>\"\n- PAGE \"select <option> in the <field label> dropdown\"\n- PAGE \"check the <label> checkbox\"\n- PAGE \"click the <button text> button\"\n- press \"Enter\"\n\n\u2550\u2550\u2550 Autocomplete fields \u2550\u2550\u2550\n\nFields marked [autocomplete] are typeahead/combobox fields.\n- ALWAYS use \"autocomplete field\" phrasing so the runtime handles the dropdown.\n- Default to first suggestion unless the step names a specific choice.\n- Type a short search term likely to produce results.\n\n\u2550\u2550\u2550 Test data \u2550\u2550\u2550\n\n- Explicit values in the step \u2192 use EXACTLY (match by field purpose, not label language).\n- Unspecified fields \u2192 generate realistic fake data based on label, placeholder, and input type.\n - Use input type (email, tel, url, number) to pick the right format.\n - For free-text/message fields \u2192 \"Test message\".\n- Select/dropdown \u2192 first non-empty option unless specified.\n- Checkboxes \u2192 check if needed (especially consent/terms checkboxes).\n- Required fields \u2192 always fill. Optional fields \u2192 fill too.\n- \"Submit\" in the step \u2192 include a click on the submit button as the last action.\n\n\u2550\u2550\u2550 Output format \u2550\u2550\u2550\n\nOne action per line. No blank lines, no numbering, no explanation.\n";
42
+ export declare const DATEPICK_SYSTEM_PROMPT = "You are filling in a date/time picker based on the actual widget visible on the page.\n\nYou receive:\n1. The original step instruction (e.g. \"set the start date to now plus 1 hour\").\n2. The current time (ISO 8601).\n3. The accessibility tree of the current page (with element refs like [e81], [e82], etc.).\n\n\u2550\u2550\u2550 Your task \u2550\u2550\u2550\n\n1. Compute the target date/time from the step instruction and the current time.\n2. Find the date/time picker elements in the accessibility tree.\n3. Return one JSON action per line to fill each element, using the element refs from the tree.\n\n\u2550\u2550\u2550 Response format \u2550\u2550\u2550\n\nRespond with one JSON object per line (no markdown, no explanation). Use the same format as The Pilot:\n\n{\"action\":\"type\",\"ref\":\"<ref>\",\"value\":\"<value>\"}\n{\"action\":\"click\",\"ref\":\"<ref>\"}\n{\"action\":\"select\",\"ref\":\"<ref>\",\"value\":\"<option>\"}\n\n\u2550\u2550\u2550 Picker types \u2550\u2550\u2550\n\n1. **Native HTML5 input** (type=\"date\", \"datetime-local\", \"time\"):\n - Single textbox element in the tree.\n - Return one type action: {\"action\":\"type\",\"ref\":\"e42\",\"value\":\"2026-03-18T21:30\"}\n - Formats: date \u2192 \"YYYY-MM-DD\", datetime-local \u2192 \"YYYY-MM-DDTHH:mm\", time \u2192 \"HH:mm\"\n\n2. **Sectioned picker** (MUI v7, etc.) \u2014 separate spinbutton elements:\n - The tree shows elements like: [e81] spinbutton \"Day\", [e82] spinbutton \"Month\", etc.\n - These are often inside a named group (e.g. group \"Start date and time\").\n - Return one type action per section using the EXACT ref from the tree:\n {\"action\":\"type\",\"ref\":\"e81\",\"value\":\"18\"}\n {\"action\":\"type\",\"ref\":\"e82\",\"value\":\"03\"}\n {\"action\":\"type\",\"ref\":\"e83\",\"value\":\"2026\"}\n {\"action\":\"type\",\"ref\":\"e84\",\"value\":\"21\"}\n {\"action\":\"type\",\"ref\":\"e85\",\"value\":\"30\"}\n - IMPORTANT: When there are multiple pickers (start/end), use the refs from the CORRECT group.\n - Use 2-digit values for month, day, hours, minutes. Use 4-digit values for year.\n - For 12-hour pickers with AM/PM (meridiem spinbutton): include a type action for it.\n\n3. **Calendar popup picker** (readonly input + calendar button):\n - Click the calendar button to open, then click the target day.\n\n\u2550\u2550\u2550 Relative time \u2550\u2550\u2550\n\n- \"now\", \"current time\" \u2192 use the provided current time\n- \"now plus 1 hour\", \"1 hour from now\" \u2192 add 1 hour to current time\n- \"10 minutes from now\" \u2192 add 10 minutes to current time\n- \"tomorrow\" \u2192 next day, same time\n- Round minutes to the nearest 5 if the picker appears to use 5-minute increments.\n\n\u2550\u2550\u2550 Output \u2550\u2550\u2550\n\nOne JSON action per line. No blank lines, no numbering, no explanation. ONLY JSON.\n";
8
43
  //# sourceMappingURL=prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/pilot/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,mFAAmF;AACnF,eAAO,MAAM,aAAa,8iNAgEzB,CAAA;AAID,eAAO,MAAM,kBAAkB,uhSAmE9B,CAAA;AAID,eAAO,MAAM,oBAAoB,+4GAmChC,CAAA"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/pilot/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAMH,mFAAmF;AACnF,eAAO,MAAM,aAAa,ojOAmHzB,CAAA;AAMD,eAAO,MAAM,kBAAkB,m1WAsG9B,CAAA;AAMD,eAAO,MAAM,oBAAoB,g/DAuChC,CAAA;AAMD,eAAO,MAAM,sBAAsB,y1FAuDlC,CAAA"}