@muggleai/works 5.22.0-staging.155 → 5.22.0-staging.156

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.
@@ -362,6 +362,80 @@ var STEP_LIST_ELISION_THRESHOLD = 20;
362
362
  var STEP_LIST_HEAD_COUNT = 12;
363
363
  var STEP_LIST_TAIL_COUNT = 8;
364
364
  var STEP_ELEMENT_ID_SUFFIX = /\s*with element id (?:\[\d+\]|#\d+)/g;
365
+ var STEP_SCREENSHOT_MARKER = "\u{1F4F7}";
366
+ var TEST_DETAILS_DIVIDER = "---";
367
+ var TEST_DETAILS_ANCHOR_PREFIX = "muggle-test-";
368
+ var STEP_THUMBNAIL_WIDTH_PX = 840;
369
+ var STEP_THUMBNAIL_QUALITY = 70;
370
+ var STEP_PAIR_IMAGE_WIDTH = 420;
371
+ var MAX_COMMENT_BYTES = 64e3;
372
+
373
+ // src/cli/pr-section/resolve-urls-types.ts
374
+ var GS_SCHEME = "gs://";
375
+ var PUBLIC_URL_PATH = "/v1/protected/storage/publicUrl";
376
+ var RESOLVE_TIMEOUT_MS = 1e4;
377
+ var LOG_PREFIX = "build-pr-section";
378
+ var IMAGE_PROXY_PREFIX = "https://images.weserv.nl/?url=";
379
+ var StepSchema = z.object({
380
+ stepIndex: z.number().int().nonnegative(),
381
+ action: z.string().min(1),
382
+ description: z.string().min(1).optional(),
383
+ screenshotUrl: z.string().url(),
384
+ afterScreenshotUrl: z.string().url().optional()
385
+ });
386
+ var PassedTestSchema = z.object({
387
+ name: z.string().min(1),
388
+ testCaseId: z.string().min(1),
389
+ testScriptId: z.string().min(1).optional(),
390
+ runId: z.string().min(1),
391
+ viewUrl: z.string().url(),
392
+ status: z.literal("passed"),
393
+ steps: z.array(StepSchema),
394
+ useCaseName: z.string().min(1).optional(),
395
+ description: z.string().min(1).optional(),
396
+ endingScreenshotUrl: z.string().url().optional(),
397
+ endingScreenshotCaption: z.string().min(1).optional()
398
+ });
399
+ var FailedTestSchema = z.object({
400
+ name: z.string().min(1),
401
+ testCaseId: z.string().min(1),
402
+ testScriptId: z.string().min(1).optional(),
403
+ runId: z.string().min(1),
404
+ viewUrl: z.string().url(),
405
+ status: z.literal("failed"),
406
+ steps: z.array(StepSchema),
407
+ failureStepIndex: z.number().int().nonnegative(),
408
+ error: z.string().min(1),
409
+ artifactsDir: z.string().min(1).optional(),
410
+ useCaseName: z.string().min(1).optional(),
411
+ description: z.string().min(1).optional(),
412
+ endingScreenshotUrl: z.string().url().optional(),
413
+ endingScreenshotCaption: z.string().min(1).optional()
414
+ });
415
+ var InconclusiveTestSchema = z.object({
416
+ name: z.string().min(1),
417
+ testCaseId: z.string().min(1),
418
+ testScriptId: z.string().min(1).optional(),
419
+ runId: z.string().min(1),
420
+ viewUrl: z.string().url(),
421
+ status: z.literal("inconclusive"),
422
+ steps: z.array(StepSchema),
423
+ reason: z.string().min(1),
424
+ artifactsDir: z.string().min(1).optional(),
425
+ useCaseName: z.string().min(1).optional(),
426
+ description: z.string().min(1).optional(),
427
+ endingScreenshotUrl: z.string().url().optional(),
428
+ endingScreenshotCaption: z.string().min(1).optional()
429
+ });
430
+ var TestResultSchema = z.discriminatedUnion("status", [
431
+ PassedTestSchema,
432
+ FailedTestSchema,
433
+ InconclusiveTestSchema
434
+ ]);
435
+ var E2eReportSchema = z.object({
436
+ projectId: z.string().min(1),
437
+ tests: z.array(TestResultSchema)
438
+ });
365
439
 
366
440
  // src/cli/pr-section/render.ts
367
441
  function resolveLatestRuns(tests) {
@@ -503,14 +577,26 @@ function renderOverview(report) {
503
577
  if (entry.type === "test") {
504
578
  lines.push(renderOverviewBullet(entry.entry, numbering, ""));
505
579
  } else {
506
- lines.push(`- **${entry.key}**`);
507
- for (const member of entry.members) {
508
- lines.push(renderOverviewBullet(member, numbering, " "));
509
- }
580
+ lines.push(...renderUseCaseGroup(entry.key, entry.members, numbering));
510
581
  }
511
582
  }
512
583
  return lines.join("\n");
513
584
  }
585
+ function renderUseCaseGroup(useCaseName, members, numbering) {
586
+ const groupCounts = countTests(members);
587
+ const isAllPassed = groupCounts.passed === groupCounts.total;
588
+ const tally = [
589
+ groupCounts.passed > 0 ? `\u2705 ${groupCounts.passed} passed` : null,
590
+ groupCounts.failed > 0 ? `\u274C ${groupCounts.failed} failed` : null,
591
+ groupCounts.inconclusive > 0 ? `\u26A0\uFE0F ${groupCounts.inconclusive} inconclusive` : null
592
+ ].filter((part) => part !== null).join(" \xB7 ");
593
+ return [
594
+ "",
595
+ `<details${isAllPassed ? "" : " open"}><summary><b>${escapeHtml(useCaseName)}</b> \u2014 ${tally}</summary>`,
596
+ ...indented(members.map((member) => renderOverviewBullet(member, numbering, ""))),
597
+ "</details>"
598
+ ];
599
+ }
514
600
  function buildTestNumbering(latestRuns) {
515
601
  const map = /* @__PURE__ */ new Map();
516
602
  latestRuns.forEach((entry, i) => {
@@ -520,7 +606,8 @@ function buildTestNumbering(latestRuns) {
520
606
  }
521
607
  function renderOverviewBullet(entry, numbering, indent) {
522
608
  const rerunNote = entry.attempts > 1 ? ` _(${entry.attempts} runs)_` : "";
523
- return `${indent}- ${statusEmoji(entry.test)} **${numbering.get(entry.test.testCaseId)}.** ${entry.test.name}${rerunNote}`;
609
+ const detailsLink = ` \xB7 [see details](#${testAnchor(entry.test)})`;
610
+ return `${indent}- ${statusEmoji(entry.test)} **${numbering.get(entry.test.testCaseId)}.** ${entry.test.name}${rerunNote}${detailsLink}`;
524
611
  }
525
612
  function buildGroupedLayout(latestRuns) {
526
613
  const groups = /* @__PURE__ */ new Map();
@@ -542,21 +629,39 @@ function buildGroupedLayout(latestRuns) {
542
629
  }
543
630
  return layout;
544
631
  }
545
- function renderTestDetails(entry, projectId, testNumber, dashboardBaseUrl = DASHBOARD_URL_BASE) {
632
+ function renderTestDetails(entry, projectId, testNumber, dashboardBaseUrl = DASHBOARD_URL_BASE, screenshotDetail = "before-and-after" /* BeforeAndAfter */) {
546
633
  const { test } = entry;
547
- const lines = [`#### ${statusEmoji(test)} ${testNumber}. ${test.name}`, ""];
548
- if (test.description) {
634
+ const lines = [`<a name="${testAnchor(test)}"></a>`, "", `#### ${statusEmoji(test)} ${testNumber}. ${test.name}`, ""];
635
+ if (test.description && !isSameText(test.description, test.name)) {
549
636
  lines.push(`_${test.description.replace(/\s*\n\s*/g, " ")}_`, "");
550
637
  }
551
638
  lines.push(...renderResultTable(entry, projectId, dashboardBaseUrl));
552
- const steps = renderSteps(test, projectId, dashboardBaseUrl) ?? [];
639
+ const steps = renderSteps(test, projectId, dashboardBaseUrl, screenshotDetail) ?? [];
553
640
  const frame = renderEndingFrame(test) ?? [];
554
641
  const evidence = [...steps, ...steps.length > 0 && frame.length > 0 ? [""] : [], ...frame];
555
642
  if (evidence.length > 0) {
556
- lines.push("", "<details><summary><b>Steps and screenshots</b></summary>", "", ...evidence, "", "</details>");
643
+ lines.push("", `<details><summary>${evidenceToggleLabel(test, screenshotDetail)}</summary>`, ...indented(evidence), "</details>");
557
644
  }
558
645
  return lines.join("\n");
559
646
  }
647
+ function indented(content) {
648
+ return ["<dl><dd>", "", ...content, "", "</dd></dl>"];
649
+ }
650
+ function testAnchor(test) {
651
+ return `${TEST_DETAILS_ANCHOR_PREFIX}${test.testCaseId}`;
652
+ }
653
+ function evidenceToggleLabel(test, screenshotDetail) {
654
+ const count = test.steps.length;
655
+ if (count === 0) {
656
+ return "<kbd>Show the ending screen</kbd>";
657
+ }
658
+ const stepCount = `${count} ${count === 1 ? "step" : "steps"}`;
659
+ return screenshotDetail === "none" /* None */ ? `<kbd>Show ${stepCount}</kbd>` : `<kbd>Show ${stepCount} and screenshots</kbd>`;
660
+ }
661
+ function isSameText(left, right) {
662
+ const normalize = (text) => text.trim().replace(/[\s.!?]+$/, "").replace(/\s+/g, " ").toLowerCase();
663
+ return normalize(left) === normalize(right);
664
+ }
560
665
  function renderEndingFrame(test) {
561
666
  const frame = endingFrame(test);
562
667
  if (!frame) {
@@ -568,17 +673,35 @@ function renderEndingFrame(test) {
568
673
  fullSizeImage(frame.url, test.name)
569
674
  ];
570
675
  }
571
- function renderSteps(test, projectId, dashboardBaseUrl) {
676
+ function renderStepScreenshots(step, position, screenshotDetail) {
677
+ if (!step.afterScreenshotUrl || screenshotDetail === "before-only" /* BeforeOnly */) {
678
+ return [thumbnailImage(step.screenshotUrl, STEP_IMAGE_WIDTH, `Step ${position}`)];
679
+ }
680
+ return [
681
+ "| Before | After |",
682
+ "|:--|:--|",
683
+ `| ${thumbnailImage(step.screenshotUrl, STEP_PAIR_IMAGE_WIDTH, `Step ${position} before`)} | ${thumbnailImage(step.afterScreenshotUrl, STEP_PAIR_IMAGE_WIDTH, `Step ${position} after`)} |`
684
+ ];
685
+ }
686
+ function thumbnailImage(url, displayWidth, alt) {
687
+ return `<img src="${thumbnailUrl(url)}" width="${displayWidth}" alt="${alt}">`;
688
+ }
689
+ function thumbnailUrl(url) {
690
+ const proxied = url.startsWith(IMAGE_PROXY_PREFIX) ? url : `${IMAGE_PROXY_PREFIX}${encodeURIComponent(url)}`;
691
+ return `${proxied}&amp;w=${STEP_THUMBNAIL_WIDTH_PX}&amp;q=${STEP_THUMBNAIL_QUALITY}&amp;output=jpg`;
692
+ }
693
+ function renderSteps(test, projectId, dashboardBaseUrl, screenshotDetail) {
572
694
  const { steps } = test;
573
695
  if (steps.length === 0) {
574
696
  return null;
575
697
  }
576
- const collapsible = (step, position) => `<details><summary>${position} \xB7 ${stepText(step)}</summary>
577
-
578
- <img src="${step.screenshotUrl}" width="${STEP_IMAGE_WIDTH}" alt="Step ${position}">
579
-
580
- </details>`;
581
- const heading = ["**Steps** \u2014 click a step to see its screenshot", ""];
698
+ const isTextOnly = screenshotDetail === "none" /* None */;
699
+ const collapsible = (step, position) => isTextOnly ? `- ${position} \xB7 ${stepText(step)}` : [
700
+ `<details><summary>${STEP_SCREENSHOT_MARKER} ${position} \xB7 ${stepText(step)}</summary>`,
701
+ ...indented(renderStepScreenshots(step, position, screenshotDetail)),
702
+ "</details>"
703
+ ].join("\n");
704
+ const heading = isTextOnly ? ["**Steps**", ""] : ["**Steps** \u2014 click a step to see its screenshots", ""];
582
705
  if (steps.length <= STEP_LIST_ELISION_THRESHOLD) {
583
706
  return [...heading, ...steps.map((step, i) => collapsible(step, i + 1))];
584
707
  }
@@ -595,14 +718,14 @@ function renderSteps(test, projectId, dashboardBaseUrl) {
595
718
  }
596
719
  function renderResultTable(entry, projectId, dashboardBaseUrl) {
597
720
  const { test } = entry;
598
- const rows = ["| | |", "|:--|:--|"];
721
+ const rows = [];
599
722
  if (test.status === "passed") {
600
- rows.push("| **Result** | \u2705 Passed |");
723
+ rows.push("| **Result** | \u2705 Passed |", "|:--|:--|");
601
724
  } else if (test.status === "failed") {
602
- rows.push(`| **Result** | \u274C Failed at step ${failureOrdinal(test, test.failureStepIndex)} |`);
725
+ rows.push(`| **Result** | \u274C Failed at step ${failureOrdinal(test, test.failureStepIndex)} |`, "|:--|:--|");
603
726
  rows.push(`| **Why** | ${tableCell(escapeHtml(test.error))} |`);
604
727
  } else {
605
- rows.push("| **Result** | \u26A0\uFE0F Inconclusive |");
728
+ rows.push("| **Result** | \u26A0\uFE0F Inconclusive |", "|:--|:--|");
606
729
  rows.push(`| **Why** | ${tableCell(escapeHtml(test.reason))} |`);
607
730
  }
608
731
  if (entry.attempts > 1) {
@@ -612,8 +735,12 @@ function renderResultTable(entry, projectId, dashboardBaseUrl) {
612
735
  rows.push(`| **Run** | ${count} browser ${count === 1 ? "step" : "steps"} \xB7 ${dashboardLink(test, projectId, dashboardBaseUrl)} |`);
613
736
  return rows;
614
737
  }
615
- function renderDetailBlocks(report, dashboardBaseUrl) {
616
- return resolveLatestRuns(report.tests).map((entry, i) => renderTestDetails(entry, report.projectId, i + 1, dashboardBaseUrl ?? DASHBOARD_URL_BASE)).join("\n\n");
738
+ function renderDetailBlocks(report, dashboardBaseUrl, screenshotDetail = "before-and-after" /* BeforeAndAfter */) {
739
+ return resolveLatestRuns(report.tests).map((entry, i) => renderTestDetails(entry, report.projectId, i + 1, dashboardBaseUrl ?? DASHBOARD_URL_BASE, screenshotDetail)).join(`
740
+
741
+ ${TEST_DETAILS_DIVIDER}
742
+
743
+ `);
617
744
  }
618
745
  function renderBody(report, opts) {
619
746
  const overview = renderOverview(report);
@@ -643,14 +770,16 @@ function renderComment(report, opts = {}) {
643
770
  if (report.tests.length === 0) {
644
771
  return "";
645
772
  }
773
+ const screenshotDetail = opts.screenshotDetail ?? "before-and-after" /* BeforeAndAfter */;
646
774
  return [
647
775
  "## E2E acceptance evidence (overflow)",
648
776
  "",
649
777
  "_This comment was posted because the full per-test details did not fit in the PR description._",
778
+ ...screenshotDetail === "before-and-after" /* BeforeAndAfter */ ? [] : ["", "_Step screenshots are trimmed to fit GitHub's comment size limit \u2014 open a run on Muggle AI for all of them._"],
650
779
  "",
651
780
  "### Test details",
652
781
  "",
653
- renderDetailBlocks(report, opts.dashboardBaseUrl)
782
+ renderDetailBlocks(report, opts.dashboardBaseUrl, screenshotDetail)
654
783
  ].join("\n");
655
784
  }
656
785
 
@@ -665,85 +794,32 @@ function splitWithOverflow(report, opts) {
665
794
  return { body: inlineBody, comment: null };
666
795
  }
667
796
  const spilledBody = renderBody(report, { inlineDetails: false, dashboardBaseUrl: opts.dashboardBaseUrl });
668
- const comment = renderComment(report, { dashboardBaseUrl: opts.dashboardBaseUrl });
797
+ const comment = renderFittingComment(report, opts.dashboardBaseUrl);
669
798
  return {
670
799
  body: spilledBody,
671
800
  comment: comment.length > 0 ? comment : null
672
801
  };
673
802
  }
674
- var StepSchema = z.object({
675
- stepIndex: z.number().int().nonnegative(),
676
- action: z.string().min(1),
677
- description: z.string().min(1).optional(),
678
- screenshotUrl: z.string().url()
679
- });
680
- var PassedTestSchema = z.object({
681
- name: z.string().min(1),
682
- testCaseId: z.string().min(1),
683
- testScriptId: z.string().min(1).optional(),
684
- runId: z.string().min(1),
685
- viewUrl: z.string().url(),
686
- status: z.literal("passed"),
687
- steps: z.array(StepSchema),
688
- useCaseName: z.string().min(1).optional(),
689
- description: z.string().min(1).optional(),
690
- endingScreenshotUrl: z.string().url().optional(),
691
- endingScreenshotCaption: z.string().min(1).optional()
692
- });
693
- var FailedTestSchema = z.object({
694
- name: z.string().min(1),
695
- testCaseId: z.string().min(1),
696
- testScriptId: z.string().min(1).optional(),
697
- runId: z.string().min(1),
698
- viewUrl: z.string().url(),
699
- status: z.literal("failed"),
700
- steps: z.array(StepSchema),
701
- failureStepIndex: z.number().int().nonnegative(),
702
- error: z.string().min(1),
703
- artifactsDir: z.string().min(1).optional(),
704
- useCaseName: z.string().min(1).optional(),
705
- description: z.string().min(1).optional(),
706
- endingScreenshotUrl: z.string().url().optional(),
707
- endingScreenshotCaption: z.string().min(1).optional()
708
- });
709
- var InconclusiveTestSchema = z.object({
710
- name: z.string().min(1),
711
- testCaseId: z.string().min(1),
712
- testScriptId: z.string().min(1).optional(),
713
- runId: z.string().min(1),
714
- viewUrl: z.string().url(),
715
- status: z.literal("inconclusive"),
716
- steps: z.array(StepSchema),
717
- reason: z.string().min(1),
718
- artifactsDir: z.string().min(1).optional(),
719
- useCaseName: z.string().min(1).optional(),
720
- description: z.string().min(1).optional(),
721
- endingScreenshotUrl: z.string().url().optional(),
722
- endingScreenshotCaption: z.string().min(1).optional()
723
- });
724
- var TestResultSchema = z.discriminatedUnion("status", [
725
- PassedTestSchema,
726
- FailedTestSchema,
727
- InconclusiveTestSchema
728
- ]);
729
- var E2eReportSchema = z.object({
730
- projectId: z.string().min(1),
731
- tests: z.array(TestResultSchema)
732
- });
803
+ function renderFittingComment(report, dashboardBaseUrl) {
804
+ const ladder = [
805
+ "before-and-after" /* BeforeAndAfter */,
806
+ "before-only" /* BeforeOnly */,
807
+ "none" /* None */
808
+ ];
809
+ let comment = "";
810
+ for (const screenshotDetail of ladder) {
811
+ comment = renderComment(report, { dashboardBaseUrl, screenshotDetail });
812
+ if (Buffer.byteLength(comment, "utf-8") <= MAX_COMMENT_BYTES) {
813
+ return comment;
814
+ }
815
+ }
816
+ return comment;
817
+ }
733
818
 
734
819
  // src/cli/pr-section/index.ts
735
820
  function buildPrSection(report, opts) {
736
821
  return splitWithOverflow(report, opts);
737
822
  }
738
-
739
- // src/cli/pr-section/resolve-urls-types.ts
740
- var GS_SCHEME = "gs://";
741
- var PUBLIC_URL_PATH = "/v1/protected/storage/publicUrl";
742
- var RESOLVE_TIMEOUT_MS = 1e4;
743
- var LOG_PREFIX = "build-pr-section";
744
- var IMAGE_PROXY_PREFIX = "https://images.weserv.nl/?url=";
745
-
746
- // src/cli/pr-section/resolve-urls.ts
747
823
  function errMsg(e) {
748
824
  return e instanceof Error ? e.message : String(e);
749
825
  }
@@ -773,6 +849,9 @@ function collectGsUrls(report) {
773
849
  if (isGsUrl(step.screenshotUrl)) {
774
850
  seen.add(step.screenshotUrl);
775
851
  }
852
+ if (step.afterScreenshotUrl && isGsUrl(step.afterScreenshotUrl)) {
853
+ seen.add(step.afterScreenshotUrl);
854
+ }
776
855
  }
777
856
  if (test.endingScreenshotUrl && isGsUrl(test.endingScreenshotUrl)) {
778
857
  seen.add(test.endingScreenshotUrl);
@@ -805,11 +884,16 @@ async function resolveOne(gsUrl, baseUrl, headers, stderrWrite) {
805
884
  }
806
885
  }
807
886
  function remapStep(step, urlMap) {
808
- const resolved = urlMap.get(step.screenshotUrl);
809
- if (!resolved) {
887
+ const resolvedBefore = urlMap.get(step.screenshotUrl);
888
+ const resolvedAfter = step.afterScreenshotUrl ? urlMap.get(step.afterScreenshotUrl) : void 0;
889
+ if (!resolvedBefore && !resolvedAfter) {
810
890
  return step;
811
891
  }
812
- return { ...step, screenshotUrl: resolved };
892
+ return {
893
+ ...step,
894
+ ...resolvedBefore ? { screenshotUrl: resolvedBefore } : {},
895
+ ...resolvedAfter ? { afterScreenshotUrl: resolvedAfter } : {}
896
+ };
813
897
  }
814
898
  function remapTest(test, urlMap) {
815
899
  const remapped = {
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-6ROSBSNR.js';
2
+ import { runCli } from './chunk-DLBPRPUN.js';
3
3
  import './chunk-E3T2RN6R.js';
4
4
 
5
5
  // src/cli/main.ts
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-6ROSBSNR.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-DLBPRPUN.js';
2
2
  export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-E3T2RN6R.js';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
4
- "version": "5.22.0-staging.155",
4
+ "version": "5.22.0-staging.156",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.22.0-staging.155",
3
+ "version": "5.22.0-staging.156",
4
4
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
5
- "version": "5.22.0-staging.155",
5
+ "version": "5.22.0-staging.156",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -6,4 +6,4 @@ The studio publishes every completed run — pass or fail — to the cloud durin
6
6
 
7
7
  ## Screenshots
8
8
 
9
- Per run, `muggle-remote-test-script-get` with the `cloudTestScriptId` from the run result → per step `operation.screenshotUrl`, `operation.action` and `briefExplanation`. Retain `{ stepIndex, action, description, screenshotUrl }`, with `description` taken from `briefExplanation` — `action` is only the operation verb, and the description is what the walkthrough shows a reviewer. When `cloudTestScriptId` is absent — every failed generation, per above — call `muggle-remote-action-script-get` with `cloudActionScriptId` instead; it returns the same `steps[]` shape, so a non-passing run keeps its per-step screenshots rather than collapsing to a single ending frame. Batch in parallel. These feed the `E2eReport` consumed by [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md) — the dev loop does not post to the PR.
9
+ Per run, `muggle-remote-test-script-get` with the `cloudTestScriptId` from the run result → per step `operation.screenshotUrl`, `operation.action` and `briefExplanation`. Retain `{ stepIndex, action, description, screenshotUrl, afterScreenshotUrl }`, with `description` taken from `briefExplanation` — `action` is only the operation verb, and the description is what the walkthrough shows a reviewer. `afterScreenshotUrl` is the page after the step acted: the next step's `operation.screenshotUrl` among steps that have one, and for the last such step the `summaryStep.operation.screenshotUrl` (rule and skipped operations in [`../../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../../muggle-pr-visual-walkthrough/e2e-report-assembly.md)). When `cloudTestScriptId` is absent — every failed generation, per above — call `muggle-remote-action-script-get` with `cloudActionScriptId` instead; it returns the same `steps[]` shape, so a non-passing run keeps its per-step screenshots rather than collapsing to a single ending frame. Batch in parallel. These feed the `E2eReport` consumed by [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md) — the dev loop does not post to the PR.
@@ -24,6 +24,7 @@ Fetch step screenshots in parallel — pick the right tool per run result:
24
24
  For each result:
25
25
 
26
26
  1. Build `steps[]`: `[{ stepIndex: <index>, action: steps[i].operation.action, description: steps[i].briefExplanation, screenshotUrl: steps[i].operation.screenshotUrl }, ...]`. `action` is only the operation verb (`navigate`, `click`); `description` is the agent's readable account of the step and is what the walkthrough shows — omit it only when the step has no `briefExplanation`. A non-passing run carries its steps too: fetch them with the fallback above rather than sending `[]`, which collapses its walkthrough entry to a single ending frame. Send `[]` only when the run genuinely produced no steps; those still render the failure summary header.
27
+ Add each step's `afterScreenshotUrl` — the page after the step acted, which the action script does not store. It is the `operation.screenshotUrl` of the next step that has one, skipping steps without a screenshot (`noOp`, `proceed`, `proposeStep`, `curl`, `secretSave`, `generateManagedProfile`), and for the last such step the `summaryStep.operation.screenshotUrl`. Omit it when neither exists; the walkthrough then shows the before screenshot alone. This is the same pairing the Muggle AI dashboard shows.
27
28
  2. `viewUrl` — from the run result (deep-links to the specific run).
28
29
  3. `status` — from `muggle-local-run-result-get`.
29
30
  4. If failed: also capture `failureStepIndex`, `error`, `artifactsDir` from the run result.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "release": "5.18.0",
3
- "buildId": "run-155-1",
4
- "commitSha": "ba63ca4b26455ee3ab8cf79d2293777f8192dda0",
5
- "buildTime": "2026-10-21T04:17:25Z",
3
+ "buildId": "run-156-1",
4
+ "commitSha": "5bd15d6cc0872de240bfbe041fac90c0b75d7f26",
5
+ "buildTime": "2026-10-21T05:50:00Z",
6
6
  "serviceName": "muggle-ai-works-mcp"
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@muggleai/works",
3
3
  "mcpName": "io.github.multiplex-ai/muggle",
4
- "version": "5.22.0-staging.155",
4
+ "version": "5.22.0-staging.156",
5
5
  "description": "13 years of Microsoft hyperscale engineering, packaged as a harness for your AI coding agent.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
4
- "version": "5.22.0-staging.155",
4
+ "version": "5.22.0-staging.156",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.22.0-staging.155",
3
+ "version": "5.22.0-staging.156",
4
4
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
5
- "version": "5.22.0-staging.155",
5
+ "version": "5.22.0-staging.156",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -6,4 +6,4 @@ The studio publishes every completed run — pass or fail — to the cloud durin
6
6
 
7
7
  ## Screenshots
8
8
 
9
- Per run, `muggle-remote-test-script-get` with the `cloudTestScriptId` from the run result → per step `operation.screenshotUrl`, `operation.action` and `briefExplanation`. Retain `{ stepIndex, action, description, screenshotUrl }`, with `description` taken from `briefExplanation` — `action` is only the operation verb, and the description is what the walkthrough shows a reviewer. When `cloudTestScriptId` is absent — every failed generation, per above — call `muggle-remote-action-script-get` with `cloudActionScriptId` instead; it returns the same `steps[]` shape, so a non-passing run keeps its per-step screenshots rather than collapsing to a single ending frame. Batch in parallel. These feed the `E2eReport` consumed by [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md) — the dev loop does not post to the PR.
9
+ Per run, `muggle-remote-test-script-get` with the `cloudTestScriptId` from the run result → per step `operation.screenshotUrl`, `operation.action` and `briefExplanation`. Retain `{ stepIndex, action, description, screenshotUrl, afterScreenshotUrl }`, with `description` taken from `briefExplanation` — `action` is only the operation verb, and the description is what the walkthrough shows a reviewer. `afterScreenshotUrl` is the page after the step acted: the next step's `operation.screenshotUrl` among steps that have one, and for the last such step the `summaryStep.operation.screenshotUrl` (rule and skipped operations in [`../../muggle-pr-visual-walkthrough/e2e-report-assembly.md`](../../muggle-pr-visual-walkthrough/e2e-report-assembly.md)). When `cloudTestScriptId` is absent — every failed generation, per above — call `muggle-remote-action-script-get` with `cloudActionScriptId` instead; it returns the same `steps[]` shape, so a non-passing run keeps its per-step screenshots rather than collapsing to a single ending frame. Batch in parallel. These feed the `E2eReport` consumed by [`../../muggle-pr-visual-walkthrough/SKILL.md`](../../muggle-pr-visual-walkthrough/SKILL.md) — the dev loop does not post to the PR.
@@ -24,6 +24,7 @@ Fetch step screenshots in parallel — pick the right tool per run result:
24
24
  For each result:
25
25
 
26
26
  1. Build `steps[]`: `[{ stepIndex: <index>, action: steps[i].operation.action, description: steps[i].briefExplanation, screenshotUrl: steps[i].operation.screenshotUrl }, ...]`. `action` is only the operation verb (`navigate`, `click`); `description` is the agent's readable account of the step and is what the walkthrough shows — omit it only when the step has no `briefExplanation`. A non-passing run carries its steps too: fetch them with the fallback above rather than sending `[]`, which collapses its walkthrough entry to a single ending frame. Send `[]` only when the run genuinely produced no steps; those still render the failure summary header.
27
+ Add each step's `afterScreenshotUrl` — the page after the step acted, which the action script does not store. It is the `operation.screenshotUrl` of the next step that has one, skipping steps without a screenshot (`noOp`, `proceed`, `proposeStep`, `curl`, `secretSave`, `generateManagedProfile`), and for the last such step the `summaryStep.operation.screenshotUrl`. Omit it when neither exists; the walkthrough then shows the before screenshot alone. This is the same pairing the Muggle AI dashboard shows.
27
28
  2. `viewUrl` — from the run result (deep-links to the specific run).
28
29
  3. `status` — from `muggle-local-run-result-get`.
29
30
  4. If failed: also capture `failureStepIndex`, `error`, `artifactsDir` from the run result.