@muggleai/works 5.24.0-staging.167 → 5.24.0-staging.169

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.
@@ -9,7 +9,7 @@
9
9
  "name": "muggleai",
10
10
  "source": "./plugin",
11
11
  "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.",
12
- "version": "5.24.0-staging.167"
12
+ "version": "5.24.0-staging.169"
13
13
  }
14
14
  ]
15
15
  }
@@ -1,4 +1,4 @@
1
- import { __export, getLogger, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, toolRequiresAuth, getCallerCredentials, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, OnboardingBlanketChoice, PreferenceKey, resolvePreferences } from './chunk-CUL7GQDB.js';
1
+ import { __export, getLogger, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, toolRequiresAuth, getCallerCredentials, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, OnboardingBlanketChoice, PreferenceKey, resolvePreferences } from './chunk-Y5AKXYEX.js';
2
2
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
3
  import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema } from '@modelcontextprotocol/sdk/types.js';
4
4
  import { v4 } from 'uuid';
@@ -363,6 +363,7 @@ var STEP_LIST_TAIL_COUNT = 8;
363
363
  var STEP_ELEMENT_ID_SUFFIX = /\s*with element id (?:\[\d+\]|#\d+)/g;
364
364
  var STEP_SCREENSHOT_MARKER = "\u{1F4F7}";
365
365
  var TEST_DETAILS_DIVIDER = "---";
366
+ var SHORT_ID_LABEL_SEPARATOR = " \xB7 ";
366
367
  var TEST_DETAILS_ANCHOR_PREFIX = "muggle-test-";
367
368
  var STEP_THUMBNAIL_WIDTH_PX = 840;
368
369
  var STEP_THUMBNAIL_QUALITY = 70;
@@ -490,10 +491,15 @@ var StepSchema = z.object({
490
491
  screenshotUrl: z.string().url(),
491
492
  afterScreenshotUrl: z.string().url().optional()
492
493
  });
494
+ var TEST_SHORT_ID_FIELDS = {
495
+ testCaseShortId: z.string().min(1).optional(),
496
+ replayShortId: z.string().min(1).optional()
497
+ };
493
498
  var PassedTestSchema = z.object({
494
499
  name: z.string().min(1),
495
500
  testCaseId: z.string().min(1),
496
501
  testScriptId: z.string().min(1).optional(),
502
+ ...TEST_SHORT_ID_FIELDS,
497
503
  runId: z.string().min(1),
498
504
  viewUrl: z.string().url(),
499
505
  status: z.literal("passed"),
@@ -507,6 +513,7 @@ var FailedTestSchema = z.object({
507
513
  name: z.string().min(1),
508
514
  testCaseId: z.string().min(1),
509
515
  testScriptId: z.string().min(1).optional(),
516
+ ...TEST_SHORT_ID_FIELDS,
510
517
  runId: z.string().min(1),
511
518
  viewUrl: z.string().url(),
512
519
  status: z.literal("failed"),
@@ -523,6 +530,7 @@ var InconclusiveTestSchema = z.object({
523
530
  name: z.string().min(1),
524
531
  testCaseId: z.string().min(1),
525
532
  testScriptId: z.string().min(1).optional(),
533
+ ...TEST_SHORT_ID_FIELDS,
526
534
  runId: z.string().min(1),
527
535
  viewUrl: z.string().url(),
528
536
  status: z.literal("inconclusive"),
@@ -646,6 +654,9 @@ function tableCell(s) {
646
654
  function stepText(step) {
647
655
  return escapeHtml((step.description ?? step.action).replace(STEP_ELEMENT_ID_SUFFIX, ""));
648
656
  }
657
+ function withShortId(shortId, labelledText) {
658
+ return shortId ? `${shortId}${SHORT_ID_LABEL_SEPARATOR}${labelledText}` : labelledText;
659
+ }
649
660
  function dashboardLink(test) {
650
661
  return `<a href="${escapeHtmlAttribute(test.viewUrl)}" target="_blank" rel="noopener noreferrer">Open the full run on Muggle AI \u2192</a>`;
651
662
  }
@@ -716,7 +727,8 @@ function buildTestNumbering(latestRuns) {
716
727
  function renderOverviewBullet(entry, numbering, indent) {
717
728
  const rerunNote = entry.attempts > 1 ? ` _(${entry.attempts} runs)_` : "";
718
729
  const detailsLink = ` \xB7 [see details](#${testAnchor(entry.test.testCaseId)})`;
719
- return `${indent}- ${statusEmoji(entry.test)} **${numbering.get(entry.test.testCaseId)}.** ${entry.test.name}${rerunNote}${detailsLink}`;
730
+ const testLabel = withShortId(entry.test.testCaseShortId, entry.test.name);
731
+ return `${indent}- ${statusEmoji(entry.test)} **${numbering.get(entry.test.testCaseId)}.** ${testLabel}${rerunNote}${detailsLink}`;
720
732
  }
721
733
  function buildGroupedLayout(latestRuns) {
722
734
  const groups = /* @__PURE__ */ new Map();
@@ -740,7 +752,8 @@ function buildGroupedLayout(latestRuns) {
740
752
  }
741
753
  function renderTestDetails(entry, testNumber, screenshotDetail = "before-and-after" /* BeforeAndAfter */) {
742
754
  const { test } = entry;
743
- const lines = [`<a name="${testAnchor(test.testCaseId)}"></a>`, "", `#### ${statusEmoji(test)} ${testNumber}. ${test.name}`, ""];
755
+ const testLabel = withShortId(test.testCaseShortId, test.name);
756
+ const lines = [`<a name="${testAnchor(test.testCaseId)}"></a>`, "", `#### ${statusEmoji(test)} ${testNumber}. ${testLabel}`, ""];
744
757
  if (test.description && !isSameText(test.description, test.name)) {
745
758
  lines.push(`_${test.description.replace(/\s*\n\s*/g, " ")}_`, "");
746
759
  }
@@ -841,7 +854,8 @@ function renderResultTable(entry) {
841
854
  rows.push(`| **Attempts** | ${entry.attempts} \u2014 showing the latest |`);
842
855
  }
843
856
  const count = test.steps.length;
844
- rows.push(`| **Run** | ${count} browser ${count === 1 ? "step" : "steps"} \xB7 ${dashboardLink(test)} |`);
857
+ const runSummary = withShortId(test.replayShortId, `${count} browser ${count === 1 ? "step" : "steps"}`);
858
+ rows.push(`| **Run** | ${runSummary} \xB7 ${dashboardLink(test)} |`);
845
859
  return rows;
846
860
  }
847
861
  function renderDetailBlocks(report, screenshotDetail = "before-and-after" /* BeforeAndAfter */) {
@@ -1028,7 +1042,7 @@ async function resolveGsScreenshotUrls(report, opts) {
1028
1042
  if (gsUrls.length === 0) {
1029
1043
  return report;
1030
1044
  }
1031
- const mcps = await import('./src-3I5BNAZ7.js');
1045
+ const mcps = await import('./src-DUHGV6GP.js');
1032
1046
  const credentials = await mcps.getCallerCredentialsAsync();
1033
1047
  if (!credentials.bearerToken && !credentials.apiKey) {
1034
1048
  stderrWrite(
@@ -4606,7 +4606,20 @@ var EventName;
4606
4606
  EventName2["SystemOptOutChanged"] = "system.opt_out_changed";
4607
4607
  EventName2["SystemDisclosureShown"] = "system.disclosure_shown";
4608
4608
  })(EventName || (EventName = {}));
4609
+
4610
+ // packages/mcps/src/mcp/contracts/entity-reference-constants.ts
4611
+ var SHORT_ID_REFERENCE_PATTERN = /^\s*(UC|TC|TS|R)[-\s]?0*([1-9]\d*)\s*$/i;
4612
+ var ENTITY_REFERENCE_INVALID_MESSAGE = "Expected a full ID or a short ID such as TC-42";
4609
4613
  var MuggleEntityIdSchema = z.string().uuid();
4614
+
4615
+ // packages/mcps/src/mcp/contracts/entity-reference-schema.ts
4616
+ var EntityReferenceSchema = z.string().trim().refine(
4617
+ (reference) => MuggleEntityIdSchema.safeParse(reference).success || SHORT_ID_REFERENCE_PATTERN.test(reference),
4618
+ { message: ENTITY_REFERENCE_INVALID_MESSAGE }
4619
+ ).describe("Full ID or project short ID, e.g. TC-42");
4620
+ var EntityReferenceProjectIdSchema = MuggleEntityIdSchema.optional().describe(
4621
+ "Project ID (UUID) the short ID belongs to. Required when a short ID is given; ignored for a full ID."
4622
+ );
4610
4623
  var PinnedAccountSchema = z.object({
4611
4624
  emailSecretId: MuggleEntityIdSchema.describe("Secret ID (UUID) of the secret holding the account email"),
4612
4625
  passwordSecretId: MuggleEntityIdSchema.describe("Secret ID (UUID) of the secret holding the account password")
@@ -4760,7 +4773,8 @@ var UseCaseListInputSchema = z.object({
4760
4773
  projectId: IdSchema.describe("Project ID (UUID) to list use cases for")
4761
4774
  }).merge(PaginationInputSchema);
4762
4775
  var UseCaseGetInputSchema = z.object({
4763
- useCaseId: IdSchema.describe("Use case ID (UUID) to retrieve")
4776
+ useCaseId: EntityReferenceSchema.describe("Use case to retrieve: full ID (UUID) or short ID, e.g. UC-7"),
4777
+ projectId: EntityReferenceProjectIdSchema
4764
4778
  });
4765
4779
  var UseCaseDeleteInputSchema = z.object({
4766
4780
  useCaseId: IdSchema.describe("Use case ID (UUID) to delete")
@@ -4851,7 +4865,8 @@ var TestCaseListInputSchema = z.object({
4851
4865
  projectId: IdSchema.describe("Project ID (UUID) to list test cases for")
4852
4866
  }).merge(PaginationInputSchema);
4853
4867
  var TestCaseGetInputSchema = z.object({
4854
- testCaseId: IdSchema.describe("Test case ID (UUID) to retrieve")
4868
+ testCaseId: EntityReferenceSchema.describe("Test case to retrieve: full ID (UUID) or short ID, e.g. TC-42"),
4869
+ projectId: EntityReferenceProjectIdSchema
4855
4870
  });
4856
4871
  var TestCaseDeleteInputSchema = z.object({
4857
4872
  testCaseId: IdSchema.describe("Test case ID (UUID) to delete")
@@ -4863,7 +4878,8 @@ var TestPlanGraphRebuildInputSchema = z.object({
4863
4878
  projectId: IdSchema.describe("Project ID (UUID) whose test-plan graph should be rebuilt")
4864
4879
  });
4865
4880
  var TestCaseListByUseCaseInputSchema = z.object({
4866
- useCaseId: IdSchema.describe("Use case ID (UUID) to list test cases for")
4881
+ useCaseId: EntityReferenceSchema.describe("Use case to list test cases for: full ID (UUID) or short ID, e.g. UC-7"),
4882
+ projectId: EntityReferenceProjectIdSchema
4867
4883
  });
4868
4884
  var TestCaseGenerateFromPromptInputSchema = z.object({
4869
4885
  projectId: IdSchema.describe("Project ID (UUID)"),
@@ -4910,7 +4926,8 @@ var TestScriptListInputSchema = z.object({
4910
4926
  runEnvironmentType: RunEnvironmentInputSchema
4911
4927
  }).merge(PaginationInputSchema);
4912
4928
  var TestScriptGetInputSchema = z.object({
4913
- testScriptId: IdSchema.describe("Test script ID (UUID) to retrieve")
4929
+ testScriptId: EntityReferenceSchema.describe("Test script to retrieve: full ID (UUID) or short ID, e.g. TS-118"),
4930
+ projectId: EntityReferenceProjectIdSchema
4914
4931
  });
4915
4932
  var TestScriptDeleteInputSchema = z.object({
4916
4933
  testScriptId: IdSchema.describe("Test script ID (UUID) to delete")
@@ -4934,6 +4951,10 @@ var WorkflowListRuntimesInputSchema = z.object({
4934
4951
  var WorkflowGetLatestRunInputSchema = z.object({
4935
4952
  workflowRuntimeId: IdSchema.describe("Workflow runtime ID (UUID)")
4936
4953
  });
4954
+ var WorkflowGetReplayLatestRunInputSchema = z.object({
4955
+ workflowRuntimeId: EntityReferenceSchema.describe("Replay workflow runtime ID (UUID), or the replay's short ID, e.g. R-2051"),
4956
+ projectId: EntityReferenceProjectIdSchema
4957
+ });
4937
4958
  var WorkflowStartTestCaseDetectionInputSchema = z.object({
4938
4959
  projectId: IdSchema.describe("Project ID (UUID)"),
4939
4960
  useCaseId: IdSchema.describe("Use case ID (UUID) to detect test cases for"),
@@ -4966,9 +4987,9 @@ var WorkflowGetLatestScriptGenByTestCaseInputSchema = z.object({
4966
4987
  });
4967
4988
  var WorkflowStartTestScriptReplayInputSchema = z.object({
4968
4989
  projectId: IdSchema.describe("Project ID (UUID)"),
4969
- useCaseId: IdSchema.describe("Use case ID (UUID)"),
4970
- testCaseId: IdSchema.describe("Test case ID (UUID)"),
4971
- testScriptId: IdSchema.describe("Test script ID (UUID) to replay"),
4990
+ useCaseId: EntityReferenceSchema.describe("Use case: full ID (UUID) or short ID, e.g. UC-7"),
4991
+ testCaseId: EntityReferenceSchema.describe("Test case: full ID (UUID) or short ID, e.g. TC-42"),
4992
+ testScriptId: EntityReferenceSchema.describe("Test script to replay: full ID (UUID) or short ID, e.g. TS-118"),
4972
4993
  name: z.string().min(1).describe("Workflow name"),
4973
4994
  workflowParams: WorkflowParamsSchema
4974
4995
  });
@@ -5420,6 +5441,102 @@ function getPromptServiceClient() {
5420
5441
  return clientInstance;
5421
5442
  }
5422
5443
 
5444
+ // packages/mcps/src/mcp/tools/e2e/entity-reference-resolver-constants.ts
5445
+ var SHORT_ID_ROUTE_SEGMENT = "short-ids";
5446
+ var SHORT_ID_ENTITY_NOUN_BY_TYPE = {
5447
+ ["USE_CASE" /* USE_CASE */]: "use case",
5448
+ ["TEST_CASE" /* TEST_CASE */]: "test case",
5449
+ ["TEST_SCRIPT" /* TEST_SCRIPT */]: "test script",
5450
+ ["REPLAY" /* REPLAY */]: "replay"
5451
+ };
5452
+ var USE_CASE_ID_REFERENCE_FIELD = {
5453
+ fieldName: "useCaseId",
5454
+ expectedEntityType: "USE_CASE" /* USE_CASE */,
5455
+ resolvedIdField: "entityId" /* ENTITY_ID */
5456
+ };
5457
+ var TEST_CASE_ID_REFERENCE_FIELD = {
5458
+ fieldName: "testCaseId",
5459
+ expectedEntityType: "TEST_CASE" /* TEST_CASE */,
5460
+ resolvedIdField: "entityId" /* ENTITY_ID */
5461
+ };
5462
+ var TEST_SCRIPT_ID_REFERENCE_FIELD = {
5463
+ fieldName: "testScriptId",
5464
+ expectedEntityType: "TEST_SCRIPT" /* TEST_SCRIPT */,
5465
+ resolvedIdField: "entityId" /* ENTITY_ID */
5466
+ };
5467
+ var REPLAY_WORKFLOW_RUNTIME_ID_REFERENCE_FIELD = {
5468
+ fieldName: "workflowRuntimeId",
5469
+ expectedEntityType: "REPLAY" /* REPLAY */,
5470
+ resolvedIdField: "workflowRuntimeId" /* WORKFLOW_RUNTIME_ID */
5471
+ };
5472
+
5473
+ // packages/mcps/src/mcp/tools/e2e/upstream-route-constants.ts
5474
+ var MUGGLE_TEST_PREFIX = "/v1/protected/muggle-test";
5475
+
5476
+ // packages/mcps/src/mcp/tools/e2e/entity-reference-resolver.ts
5477
+ async function resolveEntityReferencesAsync(params) {
5478
+ const shortIdFields = params.entityReferenceFields.filter((field) => isShortIdReference(params.input[field.fieldName]));
5479
+ if (shortIdFields.length === 0) {
5480
+ return params.input;
5481
+ }
5482
+ const projectId = requireProjectId(params.input, String(params.input[shortIdFields[0].fieldName]));
5483
+ const resolvedIds = await Promise.all(shortIdFields.map((field) => resolveFieldAsync({
5484
+ field,
5485
+ shortIdReference: String(params.input[field.fieldName]),
5486
+ projectId,
5487
+ credentials: params.credentials,
5488
+ correlationId: params.correlationId
5489
+ })));
5490
+ const resolvedInput = { ...params.input };
5491
+ shortIdFields.forEach((field, index) => {
5492
+ resolvedInput[field.fieldName] = resolvedIds[index];
5493
+ });
5494
+ return resolvedInput;
5495
+ }
5496
+ function isShortIdReference(fieldValue) {
5497
+ return typeof fieldValue === "string" && SHORT_ID_REFERENCE_PATTERN.test(fieldValue);
5498
+ }
5499
+ function requireProjectId(input, shortIdReference) {
5500
+ if (typeof input.projectId !== "string" || input.projectId === "") {
5501
+ throw new GatewayError({
5502
+ code: "INVALID_ARGUMENT" /* INVALID_ARGUMENT */,
5503
+ message: `Resolving ${shortIdReference} needs projectId`
5504
+ });
5505
+ }
5506
+ return input.projectId;
5507
+ }
5508
+ async function resolveFieldAsync(params) {
5509
+ const response = await getPromptServiceClient().execute(
5510
+ {
5511
+ method: "GET",
5512
+ path: `${MUGGLE_TEST_PREFIX}/projects/${encodeURIComponent(params.projectId)}/${SHORT_ID_ROUTE_SEGMENT}/${encodeURIComponent(params.shortIdReference)}`
5513
+ },
5514
+ params.credentials,
5515
+ params.correlationId
5516
+ );
5517
+ const resolution = response.data;
5518
+ if (resolution.entityType !== params.field.expectedEntityType) {
5519
+ throw new GatewayError({
5520
+ code: "INVALID_ARGUMENT" /* INVALID_ARGUMENT */,
5521
+ message: `${resolution.shortId} is a ${SHORT_ID_ENTITY_NOUN_BY_TYPE[resolution.entityType]}, not a ${SHORT_ID_ENTITY_NOUN_BY_TYPE[params.field.expectedEntityType]}`
5522
+ });
5523
+ }
5524
+ if (resolution.isDeleted) {
5525
+ throw new GatewayError({
5526
+ code: "NOT_FOUND" /* NOT_FOUND */,
5527
+ message: `${resolution.shortId} was deleted`
5528
+ });
5529
+ }
5530
+ const resolvedId = params.field.resolvedIdField === "workflowRuntimeId" /* WORKFLOW_RUNTIME_ID */ ? resolution.workflowRuntimeId : resolution.entityId;
5531
+ if (!resolvedId) {
5532
+ throw new GatewayError({
5533
+ code: "UPSTREAM_ERROR" /* UPSTREAM_ERROR */,
5534
+ message: `${resolution.shortId} resolved without a ${params.field.resolvedIdField}`
5535
+ });
5536
+ }
5537
+ return resolvedId;
5538
+ }
5539
+
5423
5540
  // packages/mcps/src/mcp/tools/e2e/organization-list-transform.ts
5424
5541
  function mapOrganizationList(response) {
5425
5542
  const envelope = response.data;
@@ -5489,7 +5606,6 @@ function mapTestScriptsSummary(response) {
5489
5606
  }
5490
5607
 
5491
5608
  // packages/mcps/src/mcp/tools/e2e/tool-registry.ts
5492
- var MUGGLE_TEST_PREFIX = "/v1/protected/muggle-test";
5493
5609
  var getWorkflowTimeoutMs = () => getConfig().e2e.workflowTimeoutMs;
5494
5610
  var projectTools = [
5495
5611
  {
@@ -5633,6 +5749,7 @@ var useCaseTools = [
5633
5749
  name: "muggle-remote-use-case-get",
5634
5750
  description: "Get details of a specific use case by ID.",
5635
5751
  inputSchema: UseCaseGetInputSchema,
5752
+ entityReferenceFields: [USE_CASE_ID_REFERENCE_FIELD],
5636
5753
  mapToUpstream: (input) => {
5637
5754
  const toolInput = input;
5638
5755
  return {
@@ -5780,6 +5897,7 @@ var testCaseTools = [
5780
5897
  name: "muggle-remote-test-case-get",
5781
5898
  description: "Get details of a specific test case.",
5782
5899
  inputSchema: TestCaseGetInputSchema,
5900
+ entityReferenceFields: [TEST_CASE_ID_REFERENCE_FIELD],
5783
5901
  mapToUpstream: (input) => {
5784
5902
  const toolInput = input;
5785
5903
  return {
@@ -5816,6 +5934,7 @@ var testCaseTools = [
5816
5934
  name: "muggle-remote-test-case-list-by-use-case",
5817
5935
  description: "List test cases for a specific use case.",
5818
5936
  inputSchema: TestCaseListByUseCaseInputSchema,
5937
+ entityReferenceFields: [USE_CASE_ID_REFERENCE_FIELD],
5819
5938
  mapToUpstream: (input) => {
5820
5939
  const toolInput = input;
5821
5940
  return {
@@ -5993,6 +6112,7 @@ var testScriptTools = [
5993
6112
  name: "muggle-remote-test-script-get",
5994
6113
  description: "Get details of a specific test script.",
5995
6114
  inputSchema: TestScriptGetInputSchema,
6115
+ entityReferenceFields: [TEST_SCRIPT_ID_REFERENCE_FIELD],
5996
6116
  mapToUpstream: (input) => {
5997
6117
  const toolInput = input;
5998
6118
  return {
@@ -6205,6 +6325,7 @@ var workflowTools = [
6205
6325
  name: "muggle-remote-workflow-start-test-script-replay",
6206
6326
  description: "Start a test script replay workflow to execute a single test script.",
6207
6327
  inputSchema: WorkflowStartTestScriptReplayInputSchema,
6328
+ entityReferenceFields: [USE_CASE_ID_REFERENCE_FIELD, TEST_CASE_ID_REFERENCE_FIELD, TEST_SCRIPT_ID_REFERENCE_FIELD],
6208
6329
  mapToUpstream: (input) => {
6209
6330
  const toolInput = input;
6210
6331
  return {
@@ -6224,8 +6345,9 @@ var workflowTools = [
6224
6345
  },
6225
6346
  {
6226
6347
  name: "muggle-remote-wf-get-ts-replay-latest-run",
6227
- description: "Get the latest run status for a test script replay workflow runtime.",
6228
- inputSchema: WorkflowGetLatestRunInputSchema,
6348
+ description: "Get the latest run status for a test script replay workflow runtime. A replay short ID such as R-2051 resolves to that replay's workflow runtime, and the tool returns that runtime's latest run.",
6349
+ inputSchema: WorkflowGetReplayLatestRunInputSchema,
6350
+ entityReferenceFields: [REPLAY_WORKFLOW_RUNTIME_ID_REFERENCE_FIELD],
6229
6351
  mapToUpstream: (input) => {
6230
6352
  const toolInput = input;
6231
6353
  return {
@@ -7156,12 +7278,18 @@ async function executeQaTool(toolName, input, correlationId) {
7156
7278
  };
7157
7279
  }
7158
7280
  const credentials = await getCallerCredentialsAsync();
7281
+ const resolvedInput = await resolveEntityReferencesAsync({
7282
+ entityReferenceFields: tool.entityReferenceFields ?? [],
7283
+ input: validatedInput,
7284
+ credentials,
7285
+ correlationId
7286
+ });
7159
7287
  try {
7160
- const upstreamCall = tool.mapToUpstream(validatedInput);
7288
+ const upstreamCall = tool.mapToUpstream(resolvedInput);
7161
7289
  const client = getPromptServiceClient();
7162
7290
  const response = await client.execute(upstreamCall, credentials, correlationId);
7163
7291
  const mapper = tool.mapFromUpstream || defaultResponseMapper;
7164
- const mappedResponse = mapper(response, validatedInput);
7292
+ const mappedResponse = mapper(response, resolvedInput);
7165
7293
  return {
7166
7294
  content: JSON.stringify(mappedResponse, null, 2),
7167
7295
  isError: false
@@ -7169,7 +7297,7 @@ async function executeQaTool(toolName, input, correlationId) {
7169
7297
  } catch (error) {
7170
7298
  if (error instanceof Error && error.message === "RECOMMENDATION_ONLY") {
7171
7299
  const mapper = tool.mapFromUpstream || defaultResponseMapper;
7172
- const mappedResponse = mapper({ statusCode: 200, data: {}, headers: {} }, validatedInput);
7300
+ const mappedResponse = mapper({ statusCode: 200, data: {}, headers: {} }, resolvedInput);
7173
7301
  return {
7174
7302
  content: JSON.stringify(mappedResponse, null, 2),
7175
7303
  isError: false
@@ -8391,6 +8519,7 @@ __export(e2e_exports2, {
8391
8519
  WorkflowGetLatestRunInputSchema: () => WorkflowGetLatestRunInputSchema,
8392
8520
  WorkflowGetLatestScriptGenByTestCaseInputSchema: () => WorkflowGetLatestScriptGenByTestCaseInputSchema,
8393
8521
  WorkflowGetReplayBulkBatchSummaryInputSchema: () => WorkflowGetReplayBulkBatchSummaryInputSchema,
8522
+ WorkflowGetReplayLatestRunInputSchema: () => WorkflowGetReplayLatestRunInputSchema,
8394
8523
  WorkflowListRuntimesInputSchema: () => WorkflowListRuntimesInputSchema,
8395
8524
  WorkflowMemoryParamsSchema: () => WorkflowMemoryParamsSchema,
8396
8525
  WorkflowParamsSchema: () => WorkflowParamsSchema,
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-OPJUT6PX.js';
3
- import './chunk-CUL7GQDB.js';
2
+ import { runCli } from './chunk-NC43LVME.js';
3
+ import './chunk-Y5AKXYEX.js';
4
4
 
5
5
  // src/cli/main.ts
6
6
  runCli().catch((error) => {
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-OPJUT6PX.js';
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-CUL7GQDB.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-NC43LVME.js';
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-Y5AKXYEX.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.24.0-staging.167",
4
+ "version": "5.24.0-staging.169",
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.24.0-staging.167",
3
+ "version": "5.24.0-staging.169",
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.24.0-staging.167",
5
+ "version": "5.24.0-staging.169",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -64,19 +64,21 @@ For a `local-e2e` block, use `localUrl`, `projectId`, and the working-tree path
64
64
 
65
65
  `state.md` records `Wave: on` → this stage runs **once for the whole wave**, not per repo, per [`wave-e2e.md`](wave-e2e.md): the wave stack starts from every member's worktree, test cases are selected against the union of diffs, each case runs once, and each failure names its `implicatedRepo`. The steps below apply with those changes.
66
66
 
67
- ### Step 0.5: Pre-flight verification probes
67
+ ### Step 0.5: Readiness check
68
68
 
69
- Before launching the local runner:
69
+ A `local-e2e` cycle runs these before any `muggle-local-execute-*` call, every cycle — even when pre-flight already reported the app ready, since a server can die while stages 2–5 run and a healthy one fast-exits:
70
70
 
71
- 1. **Dev-server + backend readiness** — invoke [`muggle-test-prepare`](../muggle-test-prepare/SKILL.md), the readiness/service-start owner (idempotent fast-exit when healthy; probes via `dev-server-readiness.md`). Halt on failure.
71
+ 1. **Dev-server + backend readiness** — invoke [`muggle-test-prepare`](../muggle-test-prepare/SKILL.md), the readiness/service-start owner (idempotent fast-exit when healthy; probes via `dev-server-readiness.md` and starts what is down). Still not ready after its start attempts → the readiness halt below.
72
72
  2. **Auth** — `muggle-remote-auth-status` must be `authenticated`; else escalate.
73
73
  3. **Identity tenant/domain match** — if test credentials were marked `existing`, confirm the repo's configured identity tenant/domain matches the recorded tenant/domain. Mismatch → halt.
74
74
 
75
+ **Readiness halt.** The cycle planned a browser run and still owes it, so an app that cannot be brought up halts the cycle and is never a `SKIPPED` exit: declare no skip code, write no waiver, run nothing downstream. Report the URL probed, what `muggle-test-prepare` tried (the start command and how it failed), and that no PR was opened or updated; then end the turn and wait for the user. This holds for unattended runs and for a request that asked for the PR. A forward cycle opens no PR, posts no walkthrough, runs no Stage 7.5 and arms no watcher; a watcher cycle pushes nothing and escalates through its own path, which keeps the watcher running. A run that failed because the app never answered (connection refused, page never loaded) returns to item 1, and still down is this halt. A Stop-hook reminder that E2E is still owed does not lift it.
76
+
75
77
  ### Step 1: Authentication already verified
76
78
 
77
79
  Pre-flight handled auth. If `muggle-remote-auth-status` somehow shows expired here (session clock skew, etc.), re-auth silently via `muggle-remote-auth-login` + `muggle-remote-auth-poll` — but do not ask the user "continue with this account?" again.
78
80
 
79
- If validation is `unit-only` or `skip`, emit a `SKIPPED` report citing the code that holds — `NO_WEB_SURFACE` when the repo has nothing to drive, `DEV_SERVER_UNREACHABLE` when it does but nothing answers — and exit cleanly.
81
+ If validation is `unit-only` or `skip`, emit a `SKIPPED` report citing the code that holds — `NO_WEB_SURFACE` when the repo has nothing to drive, `DEV_SERVER_UNREACHABLE` when it does but nothing answers — and exit cleanly. This is the only exit `DEV_SERVER_UNREACHABLE` belongs to, because pre-flight never planned a browser run; on a `local-e2e` cycle an unreachable server is the Step 0.5 readiness halt.
80
82
 
81
83
  If validation is `staging-replay`, emit `INCONCLUSIVE` with reason `staging replay not handled in Stage 6 local runner path` and exit cleanly.
82
84
 
@@ -25,6 +25,7 @@ Read the Stage 6 run-level verdict, defined in [`../_shared/failure-mode-handlin
25
25
 
26
26
  - `PASS` or `SKIPPED` → nothing to repair. Append `e2e-repair: clear (<verdict>)` to the iteration log and hand to Stage 8.
27
27
  - A verdict the user waived earlier in this session → clear on the recorded waiver; never re-ask.
28
+ - An entry whose run never reached the app — connection refused, page never loaded — is the readiness halt of [`e2e-acceptance.md`](e2e-acceptance.md) Step 0.5 arriving late. Nothing ran, so there is nothing to repair and nothing to waive, attended or not: re-check readiness there, and if the app is still down, stop as Step 4's **Stop here** and report the halt.
28
29
  - `FAIL`, `PARTIAL`, `INCONCLUSIVE`, or `BLOCKED` → the loop runs over every entry in the Failed and Inconclusive blocks.
29
30
 
30
31
  ## Step 1: Root-cause each failure
@@ -73,7 +74,7 @@ One question, listing each unrepairable failure with its bucket, failing step, a
73
74
  3. **Waive and ship** — record the waiver in `state.md`, retitle the PR `[E2E FAILING]`, and clear to Stage 8.
74
75
  4. **Stop here** — leave the PR open and unwatched; the user takes it from there.
75
76
 
76
- **Unattended runs.** When the cycle was started autonomously there is nobody to ask. Do not skip the loop — run Steps 1–3 in full, then treat a surviving `ask` as an automatic waive: emit the escalation event, retitle `[E2E FAILING]`, and clear to Stage 8. Silently arming the watcher on a red run is the failure this stage exists to prevent.
77
+ **Unattended runs.** When the cycle was started autonomously there is nobody to ask. Do not skip the loop — run Steps 1–3 in full, then treat a surviving `ask` as an automatic waive: emit the escalation event, retitle `[E2E FAILING]`, and clear to Stage 8. A readiness halt (Step 0) is not an `ask` and is never auto-waived. Silently arming the watcher on a red run is the failure this stage exists to prevent.
77
78
 
78
79
  ## Step 5: Close the loop
79
80
 
@@ -20,7 +20,7 @@ Forward pipeline's Stage 7. Invoked by `/muggle-do` after stages 1–6 of a fres
20
20
 
21
21
  ## Per repo
22
22
 
23
- 0. **`autoCreatePR` gate** — apply per [`../../muggle-preferences/preference-gates/autoCreatePR.md`](../../muggle-preferences/preference-gates/autoCreatePR.md). On skip, record the reason in `result.md` and move on.
23
+ 0. **`autoCreatePR` gate** — apply per [`../../muggle-preferences/preference-gates/autoCreatePR.md`](../../muggle-preferences/preference-gates/autoCreatePR.md), its explicit-request rule included. On skip, record the reason in `result.md` and move on.
24
24
 
25
25
  1. **Sync with the base:** run [`../../_shared/sync-branch-with-base.md`](../../_shared/sync-branch-with-base.md) with `base` set to the PR target recorded in `state.md` — gated by [`autoRebase`](../../muggle-preferences/preference-gates/autoRebase.md), fires only when `behind > 0`. The branch is not on the remote yet, so the rebase lands without a force-push. Sync here rather than trusting stage 6: a `unit-only` or `skip` run never reaches the E2E stage's sync at all, and on a run that does, the base moves freely while stages 3–6 build and test. If the sync escalates — conflicts under `autoResolveConflicts=never`, or a resolution that fails the verify-or-rollback gate — stop and report; never open a PR on a tree that did not verify.
26
26
 
@@ -52,7 +52,7 @@ Do not create or update a PR until each line holds, or is waived by a one-line r
52
52
  - E2E verdict recorded with `runId` per `autoE2ETest` — or `[E2E FAILING]`, or `SKIPPED` citing a verified skip code from [`../do/e2e-acceptance.md`](../do/e2e-acceptance.md), where each code's verification rule lives. Free-text reasons are rejected by the gate
53
53
  - UI changes verified in a real browser with evidence (screenshot path or muggle `runId`); `curl` + `grep` is not verification
54
54
 
55
- Opening a PR with an unchecked, unwaived line is a cycle failure.
55
+ Opening a PR with an unchecked, unwaived line is a cycle failure. A Stage 6 readiness halt ([`../do/e2e-acceptance.md`](../do/e2e-acceptance.md) Step 0.5) leaves the E2E line open: no skip code, waiver, or explicit request to open the PR closes it.
56
56
 
57
57
  ## Address-reviews flow
58
58
 
@@ -40,6 +40,8 @@ Reach this branch only when the run result carries no `viewUrl` / `cloudActionSc
40
40
 
41
41
  On every entry: `description` (test case title/description — drives the collapsible header) and `useCaseName` (parent use case title — when present, the overview groups by use case) are optional but recommended. Prefer values already in context; only call `muggle-remote-test-case-get` / `muggle-remote-use-case-get` if missing.
42
42
 
43
+ Set `testCaseShortId` to the test case's `shortId` and `replayShortId` to the run's `shortId` (e.g. `TC-42`, `R-2051`) whenever the record you already fetched carries one; the walkthrough then labels the test `TC-42 · <name>` and leads its run row with `R-2051`. Omit either when absent — entities created before short IDs existed have none.
44
+
43
45
  If called from `muggle-do`: `e2e-acceptance.md` already produces this shape — pass it through unchanged.
44
46
 
45
47
  ## Shape
@@ -53,8 +55,10 @@ If called from `muggle-do`: `e2e-acceptance.md` already produces this shape —
53
55
  "description": "<one-line description (recommended)>",
54
56
  "useCaseName": "<parent use case title (recommended)>",
55
57
  "testCaseId": "<testCaseId from execution step>",
58
+ "testCaseShortId": "<test case shortId, when it has one>",
56
59
  "testScriptId": "<cloudTestScriptId from run result>",
57
60
  "runId": "<runId from muggle-local-execute-test-generation>",
61
+ "replayShortId": "<run shortId, when it has one>",
58
62
  "viewUrl": "<viewUrl from run result>",
59
63
  "status": "passed",
60
64
  "steps": [{ "stepIndex": 0, "action": "click", "description": "Click 'Accept all' to dismiss the cookie consent dialog.", "screenshotUrl": "..." }]
@@ -11,3 +11,5 @@ Controls whether the cycle pushes the working branch to remote and opens a pull
11
11
  - `always` → `Opening PR for {branch}`
12
12
  - `ask` → `Asking about PR creation`
13
13
  - `never` → `Skipping PR creation`
14
+
15
+ **Explicit request** — when the user's own words for this run ask for the PR ("open the PR", "raise a PR", "put up a PR"), take the `always` action for this run whatever the saved value, with the footer ``(You asked for the PR — overriding `autoCreatePR=<value>` for this run.)``. Invoking a skill whose job ends in a PR is not such a request. A request silent on the PR leaves the saved value in charge, and the saved value never changes. The request lifts this gate only, never a halt or an unmet Definition of Done line.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "release": "5.18.0",
3
- "buildId": "run-167-1",
4
- "commitSha": "1b8c88d9616829f6271384d1e46d7b84ed59ec56",
5
- "buildTime": "2026-10-22T20:10:32Z",
3
+ "buildId": "run-169-1",
4
+ "commitSha": "f7c342dc45cccd8005fb078ca3a8a47f28d0e47e",
5
+ "buildTime": "2026-10-22T22:46:59Z",
6
6
  "serviceName": "muggle-ai-works-mcp"
7
7
  }
@@ -1 +1 @@
1
- export { ACTION_SCRIPT_FILE_NAME, DEFAULT_PREFERENCES, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildOnboardingPlan, calculateFileChecksum, completeOnboarding, createApiKeyWithToken, createChildLogger, deleteApiKeyData, deleteCredentials, e2e_exports as e2e, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isFirstRun, loadApiKeyData, loadCredentials, local_exports as localQa, markOnboardingCompleted, mcp_exports as mcp, needsOnboarding, openBrowserUrl, performLogin, performLogout, pollDeviceCode, e2e_exports as qa, readPreferencesMetadata, readRunView, reconcileProjectPreferences, recordOnboardingSkip, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppPathOrNull, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, toolRequiresAuth, validatePreference, verifyFileChecksum, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-CUL7GQDB.js';
1
+ export { ACTION_SCRIPT_FILE_NAME, DEFAULT_PREFERENCES, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildOnboardingPlan, calculateFileChecksum, completeOnboarding, createApiKeyWithToken, createChildLogger, deleteApiKeyData, deleteCredentials, e2e_exports as e2e, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isFirstRun, loadApiKeyData, loadCredentials, local_exports as localQa, markOnboardingCompleted, mcp_exports as mcp, needsOnboarding, openBrowserUrl, performLogin, performLogout, pollDeviceCode, e2e_exports as qa, readPreferencesMetadata, readRunView, reconcileProjectPreferences, recordOnboardingSkip, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppPathOrNull, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, toolRequiresAuth, validatePreference, verifyFileChecksum, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-Y5AKXYEX.js';
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.24.0-staging.167",
4
+ "version": "5.24.0-staging.169",
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",
@@ -57,21 +57,21 @@
57
57
  "typecheck:browser-bench": "tsc --noEmit -p internal/browser-bench/tsconfig.json"
58
58
  },
59
59
  "muggleConfig": {
60
- "electronAppVersion": "1.10.6",
60
+ "electronAppVersion": "1.13.9",
61
61
  "downloadBaseUrl": "https://github.com/multiplex-ai/muggle-ai-works/releases/download",
62
62
  "runtimeTargetDefault": "staging",
63
63
  "checksumsByStream": {
64
64
  "production": {
65
- "win32-x64": "c20acdc2fd7a05039c62f9e5b079e3068d1b3a23a1b3b37b75e2a650b5401de6",
66
- "linux-x64": "5167eaed4b82fdf57b09c0525437f9c1e0942bc05418a4f993d3b7fc9c807d1f",
67
- "darwin-arm64": "f3f41d4fcd8dc9669d79215d349e9ec1e3dff82d34dce75b028ab30715530835",
68
- "darwin-x64": "eeb41783e9c1e6ca8afebd480623ccc194c9aba4349dd52992f0e514fa19f168"
65
+ "win32-x64": "807123fb84ba60a0fa38addd4477663e1f69a7bd3080639241b75ac3f25e3a82",
66
+ "linux-x64": "697c22d2cdbbe5b2a846c1a1fb9e8b10f51eaad025fa1f2d299d63f7e3a11ec6",
67
+ "darwin-arm64": "5e8ab3b3ef436e1cae23ec044795569e69343a5f7bacfd3bd4a9ef3e681b1e9b",
68
+ "darwin-x64": "1aedbd6d8ed93b63a16d9078e73d4dd8ccc21b5a7e0199cbc8f164484f27542f"
69
69
  },
70
70
  "staging": {
71
- "darwin-arm64": "58fab257672df1fe34c9bd787a4892c6bf4a62dc930794bd5b51b2491080967d",
72
- "linux-x64": "e2daf1ac47d33fb7a3c02b59abf0a29eaa9e346966fc21cd5ffa3dbd62494244",
73
- "win32-x64": "978328942eea108396917e9a0796141b588983118c45034c97f3db6431637ddc",
74
- "darwin-x64": "8892a29a91b318811012c1d74bb3f5668ed4481ce1e739e7283cb783e0b54e54"
71
+ "darwin-arm64": "3b143eb69817b3548b49ed2684059acbb09d84a47fbfacdb2c0dbe642d2475c1",
72
+ "linux-x64": "a1016173104c2df2a7479f268d6ba36114897656ac5788250bd52a6ca24f94b6",
73
+ "win32-x64": "e5f3efa7bdb26f4520fa53a6b2c39cb07ea50599a0ddd5f02729a98b38977d35",
74
+ "darwin-x64": "0346dd828f280c8a49ead29003deae2421bc443806afc5de0fc33a82efcf7e0f"
75
75
  }
76
76
  },
77
77
  "electronAppSignedFromVersion": "1.10.0",
@@ -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.24.0-staging.167",
4
+ "version": "5.24.0-staging.169",
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.24.0-staging.167",
3
+ "version": "5.24.0-staging.169",
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.24.0-staging.167",
5
+ "version": "5.24.0-staging.169",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -64,19 +64,21 @@ For a `local-e2e` block, use `localUrl`, `projectId`, and the working-tree path
64
64
 
65
65
  `state.md` records `Wave: on` → this stage runs **once for the whole wave**, not per repo, per [`wave-e2e.md`](wave-e2e.md): the wave stack starts from every member's worktree, test cases are selected against the union of diffs, each case runs once, and each failure names its `implicatedRepo`. The steps below apply with those changes.
66
66
 
67
- ### Step 0.5: Pre-flight verification probes
67
+ ### Step 0.5: Readiness check
68
68
 
69
- Before launching the local runner:
69
+ A `local-e2e` cycle runs these before any `muggle-local-execute-*` call, every cycle — even when pre-flight already reported the app ready, since a server can die while stages 2–5 run and a healthy one fast-exits:
70
70
 
71
- 1. **Dev-server + backend readiness** — invoke [`muggle-test-prepare`](../muggle-test-prepare/SKILL.md), the readiness/service-start owner (idempotent fast-exit when healthy; probes via `dev-server-readiness.md`). Halt on failure.
71
+ 1. **Dev-server + backend readiness** — invoke [`muggle-test-prepare`](../muggle-test-prepare/SKILL.md), the readiness/service-start owner (idempotent fast-exit when healthy; probes via `dev-server-readiness.md` and starts what is down). Still not ready after its start attempts → the readiness halt below.
72
72
  2. **Auth** — `muggle-remote-auth-status` must be `authenticated`; else escalate.
73
73
  3. **Identity tenant/domain match** — if test credentials were marked `existing`, confirm the repo's configured identity tenant/domain matches the recorded tenant/domain. Mismatch → halt.
74
74
 
75
+ **Readiness halt.** The cycle planned a browser run and still owes it, so an app that cannot be brought up halts the cycle and is never a `SKIPPED` exit: declare no skip code, write no waiver, run nothing downstream. Report the URL probed, what `muggle-test-prepare` tried (the start command and how it failed), and that no PR was opened or updated; then end the turn and wait for the user. This holds for unattended runs and for a request that asked for the PR. A forward cycle opens no PR, posts no walkthrough, runs no Stage 7.5 and arms no watcher; a watcher cycle pushes nothing and escalates through its own path, which keeps the watcher running. A run that failed because the app never answered (connection refused, page never loaded) returns to item 1, and still down is this halt. A Stop-hook reminder that E2E is still owed does not lift it.
76
+
75
77
  ### Step 1: Authentication already verified
76
78
 
77
79
  Pre-flight handled auth. If `muggle-remote-auth-status` somehow shows expired here (session clock skew, etc.), re-auth silently via `muggle-remote-auth-login` + `muggle-remote-auth-poll` — but do not ask the user "continue with this account?" again.
78
80
 
79
- If validation is `unit-only` or `skip`, emit a `SKIPPED` report citing the code that holds — `NO_WEB_SURFACE` when the repo has nothing to drive, `DEV_SERVER_UNREACHABLE` when it does but nothing answers — and exit cleanly.
81
+ If validation is `unit-only` or `skip`, emit a `SKIPPED` report citing the code that holds — `NO_WEB_SURFACE` when the repo has nothing to drive, `DEV_SERVER_UNREACHABLE` when it does but nothing answers — and exit cleanly. This is the only exit `DEV_SERVER_UNREACHABLE` belongs to, because pre-flight never planned a browser run; on a `local-e2e` cycle an unreachable server is the Step 0.5 readiness halt.
80
82
 
81
83
  If validation is `staging-replay`, emit `INCONCLUSIVE` with reason `staging replay not handled in Stage 6 local runner path` and exit cleanly.
82
84
 
@@ -25,6 +25,7 @@ Read the Stage 6 run-level verdict, defined in [`../_shared/failure-mode-handlin
25
25
 
26
26
  - `PASS` or `SKIPPED` → nothing to repair. Append `e2e-repair: clear (<verdict>)` to the iteration log and hand to Stage 8.
27
27
  - A verdict the user waived earlier in this session → clear on the recorded waiver; never re-ask.
28
+ - An entry whose run never reached the app — connection refused, page never loaded — is the readiness halt of [`e2e-acceptance.md`](e2e-acceptance.md) Step 0.5 arriving late. Nothing ran, so there is nothing to repair and nothing to waive, attended or not: re-check readiness there, and if the app is still down, stop as Step 4's **Stop here** and report the halt.
28
29
  - `FAIL`, `PARTIAL`, `INCONCLUSIVE`, or `BLOCKED` → the loop runs over every entry in the Failed and Inconclusive blocks.
29
30
 
30
31
  ## Step 1: Root-cause each failure
@@ -73,7 +74,7 @@ One question, listing each unrepairable failure with its bucket, failing step, a
73
74
  3. **Waive and ship** — record the waiver in `state.md`, retitle the PR `[E2E FAILING]`, and clear to Stage 8.
74
75
  4. **Stop here** — leave the PR open and unwatched; the user takes it from there.
75
76
 
76
- **Unattended runs.** When the cycle was started autonomously there is nobody to ask. Do not skip the loop — run Steps 1–3 in full, then treat a surviving `ask` as an automatic waive: emit the escalation event, retitle `[E2E FAILING]`, and clear to Stage 8. Silently arming the watcher on a red run is the failure this stage exists to prevent.
77
+ **Unattended runs.** When the cycle was started autonomously there is nobody to ask. Do not skip the loop — run Steps 1–3 in full, then treat a surviving `ask` as an automatic waive: emit the escalation event, retitle `[E2E FAILING]`, and clear to Stage 8. A readiness halt (Step 0) is not an `ask` and is never auto-waived. Silently arming the watcher on a red run is the failure this stage exists to prevent.
77
78
 
78
79
  ## Step 5: Close the loop
79
80
 
@@ -20,7 +20,7 @@ Forward pipeline's Stage 7. Invoked by `/muggle-do` after stages 1–6 of a fres
20
20
 
21
21
  ## Per repo
22
22
 
23
- 0. **`autoCreatePR` gate** — apply per [`../../muggle-preferences/preference-gates/autoCreatePR.md`](../../muggle-preferences/preference-gates/autoCreatePR.md). On skip, record the reason in `result.md` and move on.
23
+ 0. **`autoCreatePR` gate** — apply per [`../../muggle-preferences/preference-gates/autoCreatePR.md`](../../muggle-preferences/preference-gates/autoCreatePR.md), its explicit-request rule included. On skip, record the reason in `result.md` and move on.
24
24
 
25
25
  1. **Sync with the base:** run [`../../_shared/sync-branch-with-base.md`](../../_shared/sync-branch-with-base.md) with `base` set to the PR target recorded in `state.md` — gated by [`autoRebase`](../../muggle-preferences/preference-gates/autoRebase.md), fires only when `behind > 0`. The branch is not on the remote yet, so the rebase lands without a force-push. Sync here rather than trusting stage 6: a `unit-only` or `skip` run never reaches the E2E stage's sync at all, and on a run that does, the base moves freely while stages 3–6 build and test. If the sync escalates — conflicts under `autoResolveConflicts=never`, or a resolution that fails the verify-or-rollback gate — stop and report; never open a PR on a tree that did not verify.
26
26
 
@@ -52,7 +52,7 @@ Do not create or update a PR until each line holds, or is waived by a one-line r
52
52
  - E2E verdict recorded with `runId` per `autoE2ETest` — or `[E2E FAILING]`, or `SKIPPED` citing a verified skip code from [`../do/e2e-acceptance.md`](../do/e2e-acceptance.md), where each code's verification rule lives. Free-text reasons are rejected by the gate
53
53
  - UI changes verified in a real browser with evidence (screenshot path or muggle `runId`); `curl` + `grep` is not verification
54
54
 
55
- Opening a PR with an unchecked, unwaived line is a cycle failure.
55
+ Opening a PR with an unchecked, unwaived line is a cycle failure. A Stage 6 readiness halt ([`../do/e2e-acceptance.md`](../do/e2e-acceptance.md) Step 0.5) leaves the E2E line open: no skip code, waiver, or explicit request to open the PR closes it.
56
56
 
57
57
  ## Address-reviews flow
58
58
 
@@ -40,6 +40,8 @@ Reach this branch only when the run result carries no `viewUrl` / `cloudActionSc
40
40
 
41
41
  On every entry: `description` (test case title/description — drives the collapsible header) and `useCaseName` (parent use case title — when present, the overview groups by use case) are optional but recommended. Prefer values already in context; only call `muggle-remote-test-case-get` / `muggle-remote-use-case-get` if missing.
42
42
 
43
+ Set `testCaseShortId` to the test case's `shortId` and `replayShortId` to the run's `shortId` (e.g. `TC-42`, `R-2051`) whenever the record you already fetched carries one; the walkthrough then labels the test `TC-42 · <name>` and leads its run row with `R-2051`. Omit either when absent — entities created before short IDs existed have none.
44
+
43
45
  If called from `muggle-do`: `e2e-acceptance.md` already produces this shape — pass it through unchanged.
44
46
 
45
47
  ## Shape
@@ -53,8 +55,10 @@ If called from `muggle-do`: `e2e-acceptance.md` already produces this shape —
53
55
  "description": "<one-line description (recommended)>",
54
56
  "useCaseName": "<parent use case title (recommended)>",
55
57
  "testCaseId": "<testCaseId from execution step>",
58
+ "testCaseShortId": "<test case shortId, when it has one>",
56
59
  "testScriptId": "<cloudTestScriptId from run result>",
57
60
  "runId": "<runId from muggle-local-execute-test-generation>",
61
+ "replayShortId": "<run shortId, when it has one>",
58
62
  "viewUrl": "<viewUrl from run result>",
59
63
  "status": "passed",
60
64
  "steps": [{ "stepIndex": 0, "action": "click", "description": "Click 'Accept all' to dismiss the cookie consent dialog.", "screenshotUrl": "..." }]
@@ -11,3 +11,5 @@ Controls whether the cycle pushes the working branch to remote and opens a pull
11
11
  - `always` → `Opening PR for {branch}`
12
12
  - `ask` → `Asking about PR creation`
13
13
  - `never` → `Skipping PR creation`
14
+
15
+ **Explicit request** — when the user's own words for this run ask for the PR ("open the PR", "raise a PR", "put up a PR"), take the `always` action for this run whatever the saved value, with the footer ``(You asked for the PR — overriding `autoCreatePR=<value>` for this run.)``. Invoking a skill whose job ends in a PR is not such a request. A request silent on the PR leaves the saved value in charge, and the saved value never changes. The request lifts this gate only, never a halt or an unmet Definition of Done line.