prowl-tools 0.1.9 → 0.1.10

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/dist/lib.d.cts CHANGED
@@ -115,6 +115,12 @@ type HistoryEntry = {
115
115
  durationMs: number;
116
116
  startedAt: string;
117
117
  runDir?: string;
118
+ /**
119
+ * Number of retry attempts beyond the first for this run (PROWL-033). Absent or
120
+ * `0` when the run did not retry — kept optional so older `history.json` files and
121
+ * runs of hunts without a `retry` block keep parsing unchanged.
122
+ */
123
+ retries?: number;
118
124
  };
119
125
  type HistoryFile = {
120
126
  entries: HistoryEntry[];
@@ -177,6 +183,13 @@ type WaitForNetworkIdleStep = {
177
183
  timeout?: number;
178
184
  };
179
185
  };
186
+ type WaitForResponseStep = {
187
+ waitForResponse: {
188
+ url: string;
189
+ status?: number;
190
+ timeout?: number;
191
+ };
192
+ };
180
193
  type SelectOptionStep = {
181
194
  selectOption: {
182
195
  selector: string;
@@ -299,7 +312,7 @@ type AssertScreenshotStep = {
299
312
  type AssertWithAiStep = {
300
313
  assertWithAI: string;
301
314
  };
302
- type Step = NavigateStep | ClickStep | FillStep | TypeStep | PressStep | WaitStep | SelectOptionStep | SelectStep | OnDialogStep | SetInputFilesStep | InlineAssertStep | RunHuntStep | WaitForSelectorStep | WaitForUrlStep | WaitForNetworkIdleStep | HoverStep | ScrollStep | ScrollToStep | ScreenshotStep | IfStep | RepeatStep | MockRouteStep | UnmockRouteStep | EvalScriptStep | RunScriptStep | AssertScreenshotStep | AssertWithAiStep | CopyTextStep | WaitForDownloadStep;
315
+ type Step = NavigateStep | ClickStep | FillStep | TypeStep | PressStep | WaitStep | SelectOptionStep | SelectStep | OnDialogStep | SetInputFilesStep | InlineAssertStep | RunHuntStep | WaitForSelectorStep | WaitForUrlStep | WaitForNetworkIdleStep | WaitForResponseStep | HoverStep | ScrollStep | ScrollToStep | ScreenshotStep | IfStep | RepeatStep | MockRouteStep | UnmockRouteStep | EvalScriptStep | RunScriptStep | AssertScreenshotStep | AssertWithAiStep | CopyTextStep | WaitForDownloadStep;
303
316
  type Assertion = {
304
317
  selectorExists: string;
305
318
  } | {
@@ -344,6 +357,25 @@ type TraceCorrelation = {
344
357
  traceId: string;
345
358
  header: string;
346
359
  };
360
+ /**
361
+ * One attempt of a retried hunt (PROWL-033). Recorded per attempt so a passed-on-retry
362
+ * run keeps the reason each earlier attempt failed, helping tell a flaky test apart from
363
+ * a slow environment or a real regression.
364
+ */
365
+ type RetryAttempt = {
366
+ /** 1-based attempt number (attempt 1 is the initial run). */
367
+ attempt: number;
368
+ status: "pass" | "fail";
369
+ durationMs: number;
370
+ /** The first failing step on this attempt; absent when the attempt passed. */
371
+ failedStep?: {
372
+ /** 0-based index into the hunt's steps. */
373
+ index: number;
374
+ type: string;
375
+ };
376
+ /** Failure reason for this attempt; absent when it passed. */
377
+ error?: string;
378
+ };
347
379
  type RunResult = {
348
380
  status: "pass" | "fail";
349
381
  exitCode: 0 | 1;
@@ -355,6 +387,17 @@ type RunResult = {
355
387
  assertions: AssertionResult[];
356
388
  artifacts: RunArtifacts;
357
389
  traceCorrelations?: TraceCorrelation[];
390
+ /**
391
+ * Per-attempt diagnostics (PROWL-033), present only when the hunt used `retry` and
392
+ * more than one attempt ran. Absent when no retry occurred so existing consumers and
393
+ * older run artifacts keep parsing. The last entry always matches the final result.
394
+ */
395
+ retryHistory?: RetryAttempt[];
396
+ /**
397
+ * Human-readable one-line retry outcome (PROWL-033), e.g. "Passed on attempt 2 of 3
398
+ * — first failure: navigate (timeout)". Present only alongside `retryHistory`.
399
+ */
400
+ retrySummary?: string;
358
401
  };
359
402
  type CiHuntResult = {
360
403
  hunt: string;
@@ -477,6 +520,10 @@ interface SessionDriver {
477
520
  waitForNetworkIdle(options?: {
478
521
  timeout?: number;
479
522
  }): Promise<void>;
523
+ /** Resolve once a network response satisfies `predicate`, or reject on timeout. */
524
+ waitForResponse(predicate: (response: DriverResponse) => boolean, options?: {
525
+ timeout?: number;
526
+ }): Promise<void>;
480
527
  evaluate<R = unknown, A = unknown>(pageFunction: string | ((arg: A) => R | Promise<R>), arg?: A): Promise<R>;
481
528
  screenshot(options: {
482
529
  path: string;
package/dist/lib.d.ts CHANGED
@@ -115,6 +115,12 @@ type HistoryEntry = {
115
115
  durationMs: number;
116
116
  startedAt: string;
117
117
  runDir?: string;
118
+ /**
119
+ * Number of retry attempts beyond the first for this run (PROWL-033). Absent or
120
+ * `0` when the run did not retry — kept optional so older `history.json` files and
121
+ * runs of hunts without a `retry` block keep parsing unchanged.
122
+ */
123
+ retries?: number;
118
124
  };
119
125
  type HistoryFile = {
120
126
  entries: HistoryEntry[];
@@ -177,6 +183,13 @@ type WaitForNetworkIdleStep = {
177
183
  timeout?: number;
178
184
  };
179
185
  };
186
+ type WaitForResponseStep = {
187
+ waitForResponse: {
188
+ url: string;
189
+ status?: number;
190
+ timeout?: number;
191
+ };
192
+ };
180
193
  type SelectOptionStep = {
181
194
  selectOption: {
182
195
  selector: string;
@@ -299,7 +312,7 @@ type AssertScreenshotStep = {
299
312
  type AssertWithAiStep = {
300
313
  assertWithAI: string;
301
314
  };
302
- type Step = NavigateStep | ClickStep | FillStep | TypeStep | PressStep | WaitStep | SelectOptionStep | SelectStep | OnDialogStep | SetInputFilesStep | InlineAssertStep | RunHuntStep | WaitForSelectorStep | WaitForUrlStep | WaitForNetworkIdleStep | HoverStep | ScrollStep | ScrollToStep | ScreenshotStep | IfStep | RepeatStep | MockRouteStep | UnmockRouteStep | EvalScriptStep | RunScriptStep | AssertScreenshotStep | AssertWithAiStep | CopyTextStep | WaitForDownloadStep;
315
+ type Step = NavigateStep | ClickStep | FillStep | TypeStep | PressStep | WaitStep | SelectOptionStep | SelectStep | OnDialogStep | SetInputFilesStep | InlineAssertStep | RunHuntStep | WaitForSelectorStep | WaitForUrlStep | WaitForNetworkIdleStep | WaitForResponseStep | HoverStep | ScrollStep | ScrollToStep | ScreenshotStep | IfStep | RepeatStep | MockRouteStep | UnmockRouteStep | EvalScriptStep | RunScriptStep | AssertScreenshotStep | AssertWithAiStep | CopyTextStep | WaitForDownloadStep;
303
316
  type Assertion = {
304
317
  selectorExists: string;
305
318
  } | {
@@ -344,6 +357,25 @@ type TraceCorrelation = {
344
357
  traceId: string;
345
358
  header: string;
346
359
  };
360
+ /**
361
+ * One attempt of a retried hunt (PROWL-033). Recorded per attempt so a passed-on-retry
362
+ * run keeps the reason each earlier attempt failed, helping tell a flaky test apart from
363
+ * a slow environment or a real regression.
364
+ */
365
+ type RetryAttempt = {
366
+ /** 1-based attempt number (attempt 1 is the initial run). */
367
+ attempt: number;
368
+ status: "pass" | "fail";
369
+ durationMs: number;
370
+ /** The first failing step on this attempt; absent when the attempt passed. */
371
+ failedStep?: {
372
+ /** 0-based index into the hunt's steps. */
373
+ index: number;
374
+ type: string;
375
+ };
376
+ /** Failure reason for this attempt; absent when it passed. */
377
+ error?: string;
378
+ };
347
379
  type RunResult = {
348
380
  status: "pass" | "fail";
349
381
  exitCode: 0 | 1;
@@ -355,6 +387,17 @@ type RunResult = {
355
387
  assertions: AssertionResult[];
356
388
  artifacts: RunArtifacts;
357
389
  traceCorrelations?: TraceCorrelation[];
390
+ /**
391
+ * Per-attempt diagnostics (PROWL-033), present only when the hunt used `retry` and
392
+ * more than one attempt ran. Absent when no retry occurred so existing consumers and
393
+ * older run artifacts keep parsing. The last entry always matches the final result.
394
+ */
395
+ retryHistory?: RetryAttempt[];
396
+ /**
397
+ * Human-readable one-line retry outcome (PROWL-033), e.g. "Passed on attempt 2 of 3
398
+ * — first failure: navigate (timeout)". Present only alongside `retryHistory`.
399
+ */
400
+ retrySummary?: string;
358
401
  };
359
402
  type CiHuntResult = {
360
403
  hunt: string;
@@ -477,6 +520,10 @@ interface SessionDriver {
477
520
  waitForNetworkIdle(options?: {
478
521
  timeout?: number;
479
522
  }): Promise<void>;
523
+ /** Resolve once a network response satisfies `predicate`, or reject on timeout. */
524
+ waitForResponse(predicate: (response: DriverResponse) => boolean, options?: {
525
+ timeout?: number;
526
+ }): Promise<void>;
480
527
  evaluate<R = unknown, A = unknown>(pageFunction: string | ((arg: A) => R | Promise<R>), arg?: A): Promise<R>;
481
528
  screenshot(options: {
482
529
  path: string;
package/dist/lib.js CHANGED
@@ -149,7 +149,7 @@ import {
149
149
  wdaTestRunArgs,
150
150
  webOnlyReason,
151
151
  zipinfoArchiveLister
152
- } from "./chunk-2RNOK64Y.js";
152
+ } from "./chunk-SRWAF2RI.js";
153
153
  import {
154
154
  configSchema,
155
155
  huntSchema,
@@ -160,7 +160,7 @@ import {
160
160
  loadHuntMeta,
161
161
  loadHuntTags,
162
162
  stepSchema
163
- } from "./chunk-JFJQNJSJ.js";
163
+ } from "./chunk-TTZ2IL3P.js";
164
164
  export {
165
165
  ANDROID_INTERACTIVE_CLASSES,
166
166
  ANDROID_KEYCODES,
@@ -10,7 +10,7 @@ import {
10
10
  loadHuntTags,
11
11
  resolveViewport,
12
12
  warnLegacyConfigDir
13
- } from "./chunk-JFJQNJSJ.js";
13
+ } from "./chunk-TTZ2IL3P.js";
14
14
  export {
15
15
  CONFIG_DIR,
16
16
  LEGACY_CONFIG_DIR,
@@ -24,4 +24,4 @@ export {
24
24
  resolveViewport,
25
25
  warnLegacyConfigDir
26
26
  };
27
- //# sourceMappingURL=loader-JTHA4BYG.js.map
27
+ //# sourceMappingURL=loader-CAE4FPBK.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prowl-tools",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "E2E testing for native macOS apps and web apps from declarative YAML hunts.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -59,7 +59,8 @@
59
59
  "build": "tsup",
60
60
  "lint": "eslint .",
61
61
  "test": "vitest run",
62
- "test:watch": "vitest"
62
+ "test:watch": "vitest",
63
+ "audit:licenses": "node scripts/audit-licenses.mjs"
63
64
  },
64
65
  "dependencies": {
65
66
  "@modelcontextprotocol/sdk": "^1.29.0",
@@ -83,6 +84,7 @@
83
84
  "@typescript-eslint/eslint-plugin": "^7.18.0",
84
85
  "@typescript-eslint/parser": "^7.18.0",
85
86
  "eslint": "^8.57.1",
87
+ "license-checker-rseidelsohn": "^4.4.2",
86
88
  "tsup": "^8.3.5",
87
89
  "typescript": "^5.7.3",
88
90
  "vitest": "^2.1.8"