@muggleai/works 5.34.0-staging.307 → 5.34.0-staging.309

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/{chunk-L4ZDHFEJ.js → chunk-AKEZHBGS.js} +2 -2
  3. package/dist/{chunk-C4L5SKOX.js → chunk-SMUHQITB.js} +27 -14
  4. package/dist/cli.js +2 -2
  5. package/dist/index.js +2 -2
  6. package/dist/plugin/.claude-plugin/plugin.json +1 -1
  7. package/dist/plugin/.codex-mcp.json +1 -1
  8. package/dist/plugin/.codex-plugin/plugin.json +1 -1
  9. package/dist/plugin/.cursor-plugin/plugin.json +1 -1
  10. package/dist/plugin/.mcp.json +1 -1
  11. package/dist/plugin/skills/_shared/dev-loop/fresh-session.md +1 -1
  12. package/dist/plugin/skills/_shared/dev-loop/run.md +2 -1
  13. package/dist/plugin/skills/_shared/test-case-design.md +8 -0
  14. package/dist/plugin/skills/do/e2e-acceptance.md +1 -1
  15. package/dist/plugin/skills/muggle-browser-task/SKILL.md +3 -0
  16. package/dist/plugin/skills/muggle-test/SKILL.md +1 -1
  17. package/dist/plugin/skills/muggle-test/execute-remote.md +1 -1
  18. package/dist/plugin/skills/muggle-test-feature-local/SKILL.md +1 -0
  19. package/dist/plugin/skills/muggle-test-import/SKILL.md +2 -0
  20. package/dist/plugin/skills/muggle-test-regenerate-missing/SKILL.md +1 -1
  21. package/dist/release-manifest.json +4 -4
  22. package/dist/{src-Z5YREWY6.js → src-5M2MYBRC.js} +1 -1
  23. package/package.json +1 -1
  24. package/plugin/.claude-plugin/plugin.json +1 -1
  25. package/plugin/.codex-mcp.json +1 -1
  26. package/plugin/.codex-plugin/plugin.json +1 -1
  27. package/plugin/.cursor-plugin/plugin.json +1 -1
  28. package/plugin/.mcp.json +1 -1
  29. package/plugin/skills/_shared/dev-loop/fresh-session.md +1 -1
  30. package/plugin/skills/_shared/dev-loop/run.md +2 -1
  31. package/plugin/skills/_shared/test-case-design.md +8 -0
  32. package/plugin/skills/do/e2e-acceptance.md +1 -1
  33. package/plugin/skills/muggle-browser-task/SKILL.md +3 -0
  34. package/plugin/skills/muggle-test/SKILL.md +1 -1
  35. package/plugin/skills/muggle-test/execute-remote.md +1 -1
  36. package/plugin/skills/muggle-test-feature-local/SKILL.md +1 -0
  37. package/plugin/skills/muggle-test-import/SKILL.md +2 -0
  38. package/plugin/skills/muggle-test-regenerate-missing/SKILL.md +1 -1
@@ -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.34.0-staging.307"
12
+ "version": "5.34.0-staging.309"
13
13
  }
14
14
  ]
15
15
  }
@@ -1,4 +1,4 @@
1
- import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, local_exports } from './chunk-C4L5SKOX.js';
1
+ import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, local_exports } from './chunk-SMUHQITB.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';
@@ -1255,7 +1255,7 @@ async function resolveGsScreenshotUrls(report, opts) {
1255
1255
  if (gsUrls.length === 0) {
1256
1256
  return report;
1257
1257
  }
1258
- const mcps = await import('./src-Z5YREWY6.js');
1258
+ const mcps = await import('./src-5M2MYBRC.js');
1259
1259
  const credentials = await mcps.getCallerCredentialsAsync();
1260
1260
  if (!credentials.bearerToken && !credentials.apiKey) {
1261
1261
  stderrWrite(
@@ -3188,6 +3188,9 @@ function getRequiredStringField(params) {
3188
3188
  function buildLightModeWorkflowParams(isLightMode) {
3189
3189
  return isLightMode === true ? { workflowParams: { llm: { tier: "light" /* Light */ } } } : {};
3190
3190
  }
3191
+ function resolveRunDescription(params) {
3192
+ return params.storedDescription.trim() || params.runName;
3193
+ }
3191
3194
  function buildGenerationActionScript(params) {
3192
3195
  const testCaseRecord = params.testCase;
3193
3196
  const projectId = getRequiredStringField({
@@ -3245,7 +3248,7 @@ function buildGenerationActionScript(params) {
3245
3248
  },
3246
3249
  goal: params.testCase.goal,
3247
3250
  url: params.localUrl,
3248
- description: params.testCase.title,
3251
+ description: resolveRunDescription({ storedDescription: params.testCase.description, runName: params.testCase.title }),
3249
3252
  precondition: params.testCase.precondition ?? "",
3250
3253
  instructions: params.testCase.instructions ?? "",
3251
3254
  expectedResult: params.testCase.expectedResult,
@@ -3315,7 +3318,7 @@ function buildReplayActionScript(params) {
3315
3318
  },
3316
3319
  goal: params.testScript.name,
3317
3320
  url: params.localUrl,
3318
- description: params.testScript.name,
3321
+ description: resolveRunDescription({ storedDescription: params.testCaseDescription, runName: params.testScript.name }),
3319
3322
  precondition: "",
3320
3323
  expectedResult: "Replay completes without critical failures.",
3321
3324
  steps: rewrittenActionScript,
@@ -4328,6 +4331,7 @@ async function runReplayLocked(params) {
4328
4331
  const builtActionScript = buildReplayActionScript({
4329
4332
  testScript,
4330
4333
  actionScript,
4334
+ testCaseDescription: params.testCaseDescription,
4331
4335
  localUrl,
4332
4336
  runId,
4333
4337
  ownerUserId: authContent.userId,
@@ -6470,6 +6474,10 @@ async function registerAccount(email, userProvidedPassword) {
6470
6474
  }
6471
6475
  }
6472
6476
 
6477
+ // packages/mcps/src/shared/test-case-limit-constants.ts
6478
+ var TEST_CASE_LIMIT_GUIDANCE = "Anything the test must or must not touch, including which target and which path, goes in the test case's stored description before the run. A limit stated only in chat with the coding agent does not reach the run.";
6479
+ var USE_CASE_REGENERATION_WARNING = "Regeneration replaces the use case's test cases, which drops the limits stored in their descriptions; store them again afterwards.";
6480
+
6473
6481
  // packages/mcps/src/mcp/contracts/entity-reference-constants.ts
6474
6482
  var SHORT_ID_REFERENCE_PATTERN = /^\s*(UC|TC|TS|R)[-\s]?0*([1-9]\d*)\s*$/i;
6475
6483
  var ENTITY_REFERENCE_INVALID_MESSAGE = "Expected a full ID or a short ID such as TC-42";
@@ -6967,7 +6975,7 @@ var TestCaseCreateInputSchema = z.object({
6967
6975
  projectId: IdSchema.describe("Project ID (UUID)"),
6968
6976
  useCaseId: IdSchema.describe("Use case ID (UUID) to associate the test case with"),
6969
6977
  title: z.string().min(1).describe("Test case title"),
6970
- description: z.string().min(1).describe("Detailed description of what the test case validates"),
6978
+ description: z.string().min(1).describe(`Detailed description of what the test case validates. ${TEST_CASE_LIMIT_GUIDANCE}`),
6971
6979
  goal: z.string().min(1).describe("Concise, measurable goal of the test"),
6972
6980
  precondition: z.string().optional().describe("Initial state/setup required before test execution"),
6973
6981
  expectedResult: z.string().min(1).describe("Expected outcome after test execution"),
@@ -6984,7 +6992,7 @@ var TestCaseCreateInputSchema = z.object({
6984
6992
  var TestCaseUpdateInputSchema = z.object({
6985
6993
  testCaseId: IdSchema.describe("Test case ID (UUID) to update"),
6986
6994
  title: z.string().min(1).optional().describe("Updated test case title"),
6987
- description: z.string().min(1).optional().describe("Updated description"),
6995
+ description: z.string().min(1).optional().describe(`Updated description; keep the stored text and add to it. ${TEST_CASE_LIMIT_GUIDANCE}`),
6988
6996
  goal: z.string().min(1).optional().describe("Updated goal"),
6989
6997
  precondition: z.string().optional().describe("Updated precondition"),
6990
6998
  expectedResult: z.string().min(1).optional().describe("Updated expected result"),
@@ -7049,7 +7057,7 @@ var WorkflowStartTestScriptGenerationInputSchema = z.object({
7049
7057
  url: z.string().url().describe("Target website URL"),
7050
7058
  goal: z.string().min(1).describe("Test goal"),
7051
7059
  precondition: z.string().min(1).describe("Preconditions"),
7052
- instructions: z.string().min(1).describe("Step-by-step instructions"),
7060
+ instructions: z.string().min(1).describe("Text for this run. It adds to the test case's stored description, which always reaches the run, and never replaces it."),
7053
7061
  expectedResult: z.string().min(1).describe("Expected result"),
7054
7062
  runEnvironmentType: RunEnvironmentInputSchema,
7055
7063
  workflowParams: WorkflowParamsSchema
@@ -8162,7 +8170,7 @@ var useCaseTools = [
8162
8170
  },
8163
8171
  {
8164
8172
  name: "muggle-remote-use-case-update-from-prompt",
8165
- description: "Update an existing use case by regenerating its fields from a new instruction.",
8173
+ description: `Update an existing use case by regenerating its fields from a new instruction. Every call also regenerates its test cases. ${USE_CASE_REGENERATION_WARNING}`,
8166
8174
  inputSchema: UseCaseUpdateFromPromptInputSchema,
8167
8175
  mapToUpstream: (input) => {
8168
8176
  const toolInput = input;
@@ -8175,7 +8183,7 @@ var useCaseTools = [
8175
8183
  },
8176
8184
  {
8177
8185
  name: "muggle-remote-use-case-update",
8178
- description: "Directly update an existing use case's fields without invoking the LLM. Pass only the fields you want to change \u2014 others are left untouched. Use this for cheap, deterministic edits (rename, flip status DRAFT\u2192APPROVED, change priority, edit acceptance criteria). For LLM regeneration from a new instruction, use muggle-remote-use-case-update-from-prompt instead. Note: changing title, description, or url triggers background regeneration of dependent test cases on the server.",
8186
+ description: `Directly update an existing use case's fields without invoking the LLM. Pass only the fields you want to change \u2014 others are left untouched. Use this for cheap, deterministic edits (rename, flip status DRAFT\u2192APPROVED, change priority, edit acceptance criteria). For LLM regeneration from a new instruction, use muggle-remote-use-case-update-from-prompt instead. Note: a real change to title, description, or url triggers background regeneration of dependent test cases on the server; restating a stored value does not. ${USE_CASE_REGENERATION_WARNING}`,
8179
8187
  inputSchema: UseCaseUpdateInputSchema,
8180
8188
  mapToUpstream: (input) => {
8181
8189
  const toolInput = input;
@@ -8362,7 +8370,7 @@ var testCaseTools = [
8362
8370
  },
8363
8371
  {
8364
8372
  name: "muggle-remote-test-case-create",
8365
- description: "Create a new test case for a use case. Optionally place it on the project's test states: the roles it acts as (actsAsRoleIds), the state it needs to start (prerequisiteStateId) and the state it leaves when it passes (resultStateId), using ids from muggle-remote-test-chaining-catalog-get.",
8373
+ description: `Create a new test case for a use case. ${TEST_CASE_LIMIT_GUIDANCE} Optionally place it on the project's test states: the roles it acts as (actsAsRoleIds), the state it needs to start (prerequisiteStateId) and the state it leaves when it passes (resultStateId), using ids from muggle-remote-test-chaining-catalog-get.`,
8366
8374
  inputSchema: TestCaseCreateInputSchema,
8367
8375
  dashboardLink: linkToInputProjectPage("test-cases" /* TestCases */),
8368
8376
  mapToUpstream: (input) => {
@@ -8395,7 +8403,7 @@ var testCaseTools = [
8395
8403
  },
8396
8404
  {
8397
8405
  name: "muggle-remote-test-case-update",
8398
- description: "Directly update an existing test case's fields. Pass only the fields you want to change \u2014 others are left untouched. Use this for cheap, deterministic edits (rename, change status/priority, fix expected result, add tags, set or clear the pinned account with pinnedAccount, set whether every run starts from a fresh session with alwaysStartsFreshSession; pinned account and fresh session apply from the next script generation, not to existing scripts; set the roles it acts as and its prerequisite and result test states with actsAsRoleIds, prerequisiteStateId and resultStateId, null clearing each). Does not touch the associated test script \u2014 script regeneration is a separate workflow (muggle-remote-workflow-start-test-script-generation).",
8406
+ description: `Directly update an existing test case's fields. Pass only the fields you want to change \u2014 others are left untouched. ${TEST_CASE_LIMIT_GUIDANCE} Use this for cheap, deterministic edits (rename, change status/priority, fix expected result, add tags, set or clear the pinned account with pinnedAccount, set whether every run starts from a fresh session with alwaysStartsFreshSession; pinned account and fresh session apply from the next script generation, not to existing scripts; set the roles it acts as and its prerequisite and result test states with actsAsRoleIds, prerequisiteStateId and resultStateId, null clearing each). Does not touch the associated test script \u2014 script regeneration is a separate workflow (muggle-remote-workflow-start-test-script-generation).`,
8399
8407
  inputSchema: TestCaseUpdateInputSchema,
8400
8408
  mapToUpstream: (input) => {
8401
8409
  const toolInput = input;
@@ -8802,7 +8810,7 @@ var workflowTools = [
8802
8810
  },
8803
8811
  {
8804
8812
  name: "muggle-remote-workflow-start-test-script-generation",
8805
- description: "Start a test script generation workflow.",
8813
+ description: `Start a test script generation workflow. ${TEST_CASE_LIMIT_GUIDANCE}`,
8806
8814
  inputSchema: WorkflowStartTestScriptGenerationInputSchema,
8807
8815
  dashboardLink: linkToInputScriptDetails,
8808
8816
  mapToUpstream: (input) => {
@@ -10002,14 +10010,16 @@ var TestCaseDetailsSchema = z.object({
10002
10010
  id: MuggleEntityIdSchema.describe("Cloud test case ID (UUID)"),
10003
10011
  /** Test case title. */
10004
10012
  title: z.string().min(1).describe("Test case title"),
10013
+ /** Stored description; the one home for what the test must and must not touch. */
10014
+ description: z.string().describe(`Stored description from muggle-remote-test-case-get; the run reads it. ${TEST_CASE_LIMIT_GUIDANCE}`),
10005
10015
  /** Test goal. */
10006
10016
  goal: z.string().min(1).describe("Test goal - what the test should verify"),
10007
10017
  /** Expected result. */
10008
10018
  expectedResult: z.string().min(1).describe("Expected outcome after test execution"),
10009
10019
  /** Preconditions (optional). */
10010
10020
  precondition: z.string().optional().describe("Initial state/setup required before test execution"),
10011
- /** Step-by-step instructions (optional). */
10012
- instructions: z.string().optional().describe("Step-by-step instructions for the test"),
10021
+ /** Extra text for this run only (optional). */
10022
+ instructions: z.string().optional().describe("Extra text for this run only. It adds to the stored description and never replaces it."),
10013
10023
  /** Original cloud URL (for reference, replaced by localUrl). */
10014
10024
  url: z.string().url().optional().describe("Original cloud URL (replaced by localUrl during execution)"),
10015
10025
  /** Cloud project ID (required for electron workflow context). */
@@ -10082,6 +10092,8 @@ var ExecuteReplayInputSchema = z.object({
10082
10092
  testScript: TestScriptDetailsSchema.describe("Test script metadata from muggle-remote-test-script-get"),
10083
10093
  /** Action script content from muggle-remote-action-script-get (using testScript.actionScriptId). */
10084
10094
  actionScript: z.array(z.unknown()).describe("Action script steps from muggle-remote-action-script-get"),
10095
+ /** Current stored description of the test case the script belongs to. */
10096
+ testCaseDescription: z.string().describe(`Copy description from muggle-remote-test-case-get for testScript.testCaseId: the replay reads the current text, not the text from when the script was recorded. ${TEST_CASE_LIMIT_GUIDANCE}`),
10085
10097
  /** Local URL to test against. */
10086
10098
  localUrl: z.string().url().describe("Local URL to test against (e.g., http://localhost:3000)"),
10087
10099
  /** Absolute path identifying the caller's worktree. Drives the cross-worktree single-flight lock — same path = parallel allowed (intra-change), different path = waits its turn. Required: ambiguity here causes the lock to mis-key, splitting one logical change into two competing holders. */
@@ -10771,7 +10783,7 @@ function formatRunViewUrlLine(runId) {
10771
10783
  }
10772
10784
  var executeTestGenerationTool = {
10773
10785
  name: "muggle-local-execute-test-generation",
10774
- description: "Generate an end-to-end (E2E) acceptance test script by launching a real browser against your web app. The browser navigates your app, executes the test case steps (like signing up, filling forms, clicking through flows), and produces a replayable test script with screenshots. Use this to create new browser tests for any user flow. Requires a test case (from muggle-remote-test-case-get) and a localhost URL. Launches an Electron browser \u2014 the user's showElectronBrowser preference decides whether its window shows when set to always or never; under ask it defaults to a visible window and showUi: false runs it headless.",
10786
+ description: `Generate an end-to-end (E2E) acceptance test script by launching a real browser against your web app. The browser navigates your app, executes the test case steps (like signing up, filling forms, clicking through flows), and produces a replayable test script with screenshots. Use this to create new browser tests for any user flow. Requires a test case (from muggle-remote-test-case-get) and a localhost URL. ${TEST_CASE_LIMIT_GUIDANCE} Launches an Electron browser \u2014 the user's showElectronBrowser preference decides whether its window shows when set to always or never; under ask it defaults to a visible window and showUi: false runs it headless.`,
10775
10787
  inputSchema: ExecuteTestGenerationInputSchema,
10776
10788
  execute: async (ctx) => {
10777
10789
  const logger7 = createChildLogger2(ctx.correlationId);
@@ -10842,7 +10854,7 @@ var executeTestGenerationTool = {
10842
10854
  };
10843
10855
  var executeReplayTool = {
10844
10856
  name: "muggle-local-execute-replay",
10845
- description: "Replay an existing E2E acceptance test script in a real browser to verify your app still works correctly \u2014 use this for regression testing after code changes. The browser executes each saved step and captures screenshots so you can see what happened. Requires: (1) test script metadata from muggle-remote-test-script-get, (2) actionScript content from muggle-remote-action-script-get using the testScript.actionScriptId, and (3) a localhost URL. Launches an Electron browser \u2014 the user's showElectronBrowser preference decides whether its window shows when set to always or never; under ask it defaults to a visible window and showUi: false runs it headless.",
10857
+ description: `Replay an existing E2E acceptance test script in a real browser to verify your app still works correctly \u2014 use this for regression testing after code changes. The browser executes each saved step and captures screenshots so you can see what happened. Requires: (1) test script metadata from muggle-remote-test-script-get, (2) actionScript content from muggle-remote-action-script-get using the testScript.actionScriptId, (3) testCaseDescription, the description from muggle-remote-test-case-get, and (4) a localhost URL. ${TEST_CASE_LIMIT_GUIDANCE} Launches an Electron browser \u2014 the user's showElectronBrowser preference decides whether its window shows when set to always or never; under ask it defaults to a visible window and showUi: false runs it headless.`,
10846
10858
  inputSchema: ExecuteReplayInputSchema,
10847
10859
  execute: async (ctx) => {
10848
10860
  const logger7 = createChildLogger2(ctx.correlationId);
@@ -10874,6 +10886,7 @@ var executeReplayTool = {
10874
10886
  execute: () => executeReplay({
10875
10887
  testScript: input.testScript,
10876
10888
  actionScript: input.actionScript,
10889
+ testCaseDescription: input.testCaseDescription,
10877
10890
  localUrl: input.localUrl,
10878
10891
  cwd: input.cwd,
10879
10892
  mutations: input.mutations,
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-L4ZDHFEJ.js';
3
- import './chunk-C4L5SKOX.js';
2
+ import { runCli } from './chunk-AKEZHBGS.js';
3
+ import './chunk-SMUHQITB.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-L4ZDHFEJ.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-C4L5SKOX.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-AKEZHBGS.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-SMUHQITB.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.34.0-staging.307",
4
+ "version": "5.34.0-staging.309",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.34.0-staging.307",
7
+ "@muggleai/works@5.34.0-staging.309",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.34.0-staging.307",
3
+ "version": "5.34.0-staging.309",
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.34.0-staging.307",
5
+ "version": "5.34.0-staging.309",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.34.0-staging.307",
7
+ "@muggleai/works@5.34.0-staging.309",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -15,7 +15,7 @@ For an older test case with no stored flag, pass `freshSession: true` when it ne
15
15
 
16
16
  ## Replay
17
17
 
18
- Replay runs as the script was recorded, never as the test case is now. Copy `pinnedAccount` and `freshSession` from the `actionParams` of the `muggle-remote-action-script-get` result onto `muggle-local-execute-replay` when present. A recording that carries neither may predate run identities, so decide its `freshSession` by the list above, as before.
18
+ A replay's account and session are the ones the script was recorded with, never the test case's current ones. Copy `pinnedAccount` and `freshSession` from the `actionParams` of the `muggle-remote-action-script-get` result onto `muggle-local-execute-replay` when present. A recording that carries neither may predate run identities, so decide its `freshSession` by the list above, as before.
19
19
 
20
20
  ## Changing the stored value
21
21
 
@@ -49,7 +49,8 @@ Per test case, or per record when it has [records](#records), branch on `mode`:
49
49
  **Replay**
50
50
  1. `muggle-remote-test-script-get` (the record's `testScriptId`; with no records, the latest replayable script — the lane-scoped one the caller resolved during classification per [`../failure-mode-handling.md`](../failure-mode-handling.md) §A) → note `actionScriptId`.
51
51
  2. `muggle-remote-action-script-get` with that id → full `actionScript` (see [`action-script.md`](action-script.md)), plus the `pinnedAccount` and `freshSession` its `actionParams` recorded.
52
- 3. `muggle-local-execute-replay` with `testScript`, `actionScript`, `localUrl`, `cwd`, `showUi`, `pinnedAccount` and `freshSession` (each copied from the recording's `actionParams` when present; see [`fresh-session.md`](fresh-session.md)), `timeoutMs` (see [`timeouts.md`](timeouts.md)).
52
+ 3. `muggle-remote-test-case-get` for the script's `testCaseId` → its current `description`, which holds the run's [limits](../test-case-design.md#limits).
53
+ 4. `muggle-local-execute-replay` with `testScript`, `actionScript`, `testCaseDescription` (that `description`), `localUrl`, `cwd`, `showUi`, `pinnedAccount` and `freshSession` (each copied from the recording's `actionParams` when present; see [`fresh-session.md`](fresh-session.md)), `timeoutMs` (see [`timeouts.md`](timeouts.md)).
53
54
 
54
55
  **Regen**
55
56
  1. `muggle-remote-test-case-get` → full test case object.
@@ -10,3 +10,11 @@ Every test case verifies exactly **one** user-observable behavior. Never bundle
10
10
  **Never bake bootstrap into a test case description.** Signup, login, seed data, prerequisite navigation, tear-down — none of these belong inside the test case body. Write only the verification itself. Setup arrives as its own prerequisite case: the chain runs ahead of the target, and the session it leaves behind is what the target starts from. Nothing is spliced into the case body.
11
11
 
12
12
  **Never consolidate the generator's output.** When `muggle-remote-test-case-generate-from-prompt` returns N micro-tests from a single prompt, that decomposition is the authoritative one. Do not "merge them into 1 for simplicity," do not "rewrite them to share bootstrap," do not "collapse them to match a 4 UC / 4 TC plan." Accept what the generator gave you.
13
+
14
+ ## Limits
15
+
16
+ Anything a test must or must not touch, including which target and which path, goes in the test case's stored `description` before the run. A limit stated only in chat with the coding agent does not reach the run.
17
+
18
+ - Store it with `muggle-remote-test-case-create`, or with `muggle-remote-test-case-update` on an existing case, keeping the stored text and adding to it. When a generator wrote the draft, check that the limit survived into its `description`.
19
+ - Every run reads the stored text: local and cloud, generation, regeneration and replay. Text given for one run adds to it and never replaces it.
20
+ - A use case edit that really changes `title`, `description` or `url`, and every `muggle-remote-use-case-update-from-prompt` call, replaces the use case's test cases and drops their limits. Store them again afterwards.
@@ -122,7 +122,7 @@ Create what the scope planned, before any run:
122
122
 
123
123
  1. **New use cases** — one `muggle-remote-use-case-create-from-prompts` call with every `newUseCases` instruction in its `instructions` array. Map each created use case back to its key.
124
124
  2. **New test cases** — one `muggle-remote-test-case-generate-from-prompt` per `newTestCases` entry, all in one message, with `projectId`, the resolved `useCaseId`, and the entry's `instruction`.
125
- 3. **Create every generated case** — `muggle-remote-test-case-create` for each, in parallel. Accept the generator's decomposition as-is ([`../_shared/test-case-design.md`](../_shared/test-case-design.md)): N micro-tests from one instruction are N test cases. Record each `testCaseId` against its key; the report and a Stage 7.5 re-run name new cases by id.
125
+ 3. **Create every generated case** — `muggle-remote-test-case-create` for each, in parallel. Accept the generator's decomposition as-is ([`../_shared/test-case-design.md`](../_shared/test-case-design.md)): N micro-tests from one instruction are N test cases. Anything the request says a case must or must not touch goes in that case's `description` ([limits](../_shared/test-case-design.md#limits)); add it if the generator's draft dropped it. Record each `testCaseId` against its key; the report and a Stage 7.5 re-run name new cases by id.
126
126
 
127
127
  A failed create leaves its entry `INCONCLUSIVE` with reason `case creation failed: <error>`; it stays in the report.
128
128
 
@@ -108,6 +108,8 @@ Do not proceed further.
108
108
 
109
109
  2. Load and call `muggle-remote-action-script-get` with `actionScriptId`.
110
110
 
111
+ 3. Load and call `muggle-remote-test-case-get` with the test case ID from Step 4. Keep its `description`.
112
+
111
113
  Tell the user: `Executing task...`
112
114
 
113
115
  ## Step 7 — Execute locally
@@ -115,6 +117,7 @@ Tell the user: `Executing task...`
115
117
  Load and call `muggle-local-execute-replay` with:
116
118
  - `testScript`: the full object from Step 6 (from `muggle-remote-test-script-get`)
117
119
  - `actionScript`: the content from Step 6 (from `muggle-remote-action-script-get`)
120
+ - `testCaseDescription`: the `description` from Step 6 (from `muggle-remote-test-case-get`)
118
121
  - `localUrl`: from Step 1
119
122
  - `mutations`: the `mutations[]` array from Step 1 (omit if empty)
120
123
 
@@ -42,7 +42,7 @@ Reach for these when the user is weighing Muggle Test against hand-written specs
42
42
 
43
43
  ## Test Case Design: One Atomic Behavior Per Test Case
44
44
 
45
- Every test case verifies exactly **one** user-observable behavior, carries no signup, login, navigation, or seed-data steps, and the generator's decomposition is kept as-is. The full rule, with examples: [`_shared/test-case-design.md`](../_shared/test-case-design.md).
45
+ Every test case verifies exactly **one** user-observable behavior, carries no signup, login, navigation, or seed-data steps, and the generator's decomposition is kept as-is. The full rule, with examples: [`_shared/test-case-design.md`](../_shared/test-case-design.md). Anything the user said a test must or must not touch, including which target and which path, goes in its stored `description` before the run ([limits](../_shared/test-case-design.md#limits)); stated only in this chat, it does not reach the run.
46
46
 
47
47
  **Never skip the generate→review cycle.** Even when you are 100% confident about the right shape, always present the generated test cases to the user before calling `muggle-remote-test-case-create`. "I'll skip the generate→review cycle and create directly" is a sign you're about to get it wrong.
48
48
 
@@ -25,7 +25,7 @@ Branch each test case on its `mode`, then issue **all** workflow-start calls in
25
25
  - `url`: The preview/staging URL
26
26
  - `goal`: From the test case
27
27
  - `precondition`: From the test case (use `"None"` if empty)
28
- - `instructions`: From the test case
28
+ - `instructions`: The test case's `description`, plus anything specific to this run. The stored `description` always reaches the run, so a limit belongs there ([limits](../_shared/test-case-design.md#limits)).
29
29
  - `expectedResult`: From the test case
30
30
 
31
31
  **Replay-mode test case** — `muggle-remote-workflow-start-test-script-replay` against the latest replayable script for that test case (resolve via `muggle-remote-test-script-list` with `runEnvironmentType: "remote"` if not already in hand from the classification step). Tag results with `mode: "replay"` so the router routes failures correctly.
@@ -109,6 +109,7 @@ Prompt for projects: "Pick the project to group this test into:"
109
109
  - **Test case — Create new test case** (requires a chosen `useCaseId`): User provides an instruction describing what to test.
110
110
  1. `muggle-remote-test-case-generate-from-prompt` with `projectId`, `useCaseId`, `instruction` — **preview only** (server test-case prompt preview); show the returned draft(s); get confirmation via `AskUserQuestion`.
111
111
  2. Persist the accepted draft with `muggle-remote-test-case-create`, mapping preview fields into the required properties (`title`, `description`, `goal`, `expectedResult`, `url`, etc.). Then continue from **section 5** with that `testCaseId`.
112
+ - **Limits:** anything the user said the test must or must not touch, including which target and which path, goes in the chosen test case's stored `description` before the run, on a new case or an existing one ([limits](../_shared/test-case-design.md#limits)). Stated only in this chat, it does not reach the run.
112
113
 
113
114
  ### 3. Ensure Local Services Are Ready
114
115
 
@@ -343,6 +343,8 @@ For each use case, run a bulk-preview job to generate its test cases.
343
343
  url: <from testCase.url>
344
344
  ```
345
345
 
346
+ Anything the source says a test must or must not touch stays in `description`; add it if the preview dropped it ([limits](../_shared/test-case-design.md#limits)).
347
+
346
348
  Print progress: `Creating test cases for "User Authentication"... (1/3)`
347
349
 
348
350
  It is safe to create test cases for different use cases in parallel once their bulk-preview
@@ -146,7 +146,7 @@ Send a single bulk request instead of dispatching one workflow per test case:
146
146
  - `projectId` — from Step 2
147
147
  - `name` — `"muggle-test-regenerate-missing: bulk ({count} test cases)"` where `{count}` is the number of selected test cases
148
148
  - `testCaseIds` — array of all selected test case IDs from Step 5
149
- 2. The backend handles looking up full test case details (goal, precondition, instructions, expectedResult, url), so there is no need to call `muggle-remote-test-case-get` per test case.
149
+ 2. The backend handles looking up full test case details (goal, precondition, description, expectedResult, url), so there is no need to call `muggle-remote-test-case-get` per test case.
150
150
  3. Parse the response to get the `items` array with per-test-case status. Each item contains the test case ID, dispatch status, and (when successful) the workflow runtime ID.
151
151
 
152
152
  **Failure handling:** the bulk API returns per-item status in the response `items` array. Individual test cases may fail (validation error, missing field, etc.) while others succeed. Surface failures in the Step 7 report — partial progress beats no progress.
@@ -1,7 +1,7 @@
1
1
  {
2
- "release": "5.34.0-staging.307",
3
- "buildId": "run-307-1",
4
- "commitSha": "d5845b0cff2fbe9807cd46208653a5d37313153a",
5
- "buildTime": "2026-11-05T18:49:15Z",
2
+ "release": "5.34.0-staging.309",
3
+ "buildId": "run-309-1",
4
+ "commitSha": "e8afe5dda5751c7634796688ab54e5614ee527fa",
5
+ "buildTime": "2026-11-05T19:11:37Z",
6
6
  "serviceName": "muggle-ai-works-mcp"
7
7
  }
@@ -1 +1 @@
1
- export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, 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, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-C4L5SKOX.js';
1
+ export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, 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, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-SMUHQITB.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.34.0-staging.307",
4
+ "version": "5.34.0-staging.309",
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.34.0-staging.307",
4
+ "version": "5.34.0-staging.309",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.34.0-staging.307",
7
+ "@muggleai/works@5.34.0-staging.309",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.34.0-staging.307",
3
+ "version": "5.34.0-staging.309",
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.34.0-staging.307",
5
+ "version": "5.34.0-staging.309",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
package/plugin/.mcp.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.34.0-staging.307",
7
+ "@muggleai/works@5.34.0-staging.309",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -15,7 +15,7 @@ For an older test case with no stored flag, pass `freshSession: true` when it ne
15
15
 
16
16
  ## Replay
17
17
 
18
- Replay runs as the script was recorded, never as the test case is now. Copy `pinnedAccount` and `freshSession` from the `actionParams` of the `muggle-remote-action-script-get` result onto `muggle-local-execute-replay` when present. A recording that carries neither may predate run identities, so decide its `freshSession` by the list above, as before.
18
+ A replay's account and session are the ones the script was recorded with, never the test case's current ones. Copy `pinnedAccount` and `freshSession` from the `actionParams` of the `muggle-remote-action-script-get` result onto `muggle-local-execute-replay` when present. A recording that carries neither may predate run identities, so decide its `freshSession` by the list above, as before.
19
19
 
20
20
  ## Changing the stored value
21
21
 
@@ -49,7 +49,8 @@ Per test case, or per record when it has [records](#records), branch on `mode`:
49
49
  **Replay**
50
50
  1. `muggle-remote-test-script-get` (the record's `testScriptId`; with no records, the latest replayable script — the lane-scoped one the caller resolved during classification per [`../failure-mode-handling.md`](../failure-mode-handling.md) §A) → note `actionScriptId`.
51
51
  2. `muggle-remote-action-script-get` with that id → full `actionScript` (see [`action-script.md`](action-script.md)), plus the `pinnedAccount` and `freshSession` its `actionParams` recorded.
52
- 3. `muggle-local-execute-replay` with `testScript`, `actionScript`, `localUrl`, `cwd`, `showUi`, `pinnedAccount` and `freshSession` (each copied from the recording's `actionParams` when present; see [`fresh-session.md`](fresh-session.md)), `timeoutMs` (see [`timeouts.md`](timeouts.md)).
52
+ 3. `muggle-remote-test-case-get` for the script's `testCaseId` → its current `description`, which holds the run's [limits](../test-case-design.md#limits).
53
+ 4. `muggle-local-execute-replay` with `testScript`, `actionScript`, `testCaseDescription` (that `description`), `localUrl`, `cwd`, `showUi`, `pinnedAccount` and `freshSession` (each copied from the recording's `actionParams` when present; see [`fresh-session.md`](fresh-session.md)), `timeoutMs` (see [`timeouts.md`](timeouts.md)).
53
54
 
54
55
  **Regen**
55
56
  1. `muggle-remote-test-case-get` → full test case object.
@@ -10,3 +10,11 @@ Every test case verifies exactly **one** user-observable behavior. Never bundle
10
10
  **Never bake bootstrap into a test case description.** Signup, login, seed data, prerequisite navigation, tear-down — none of these belong inside the test case body. Write only the verification itself. Setup arrives as its own prerequisite case: the chain runs ahead of the target, and the session it leaves behind is what the target starts from. Nothing is spliced into the case body.
11
11
 
12
12
  **Never consolidate the generator's output.** When `muggle-remote-test-case-generate-from-prompt` returns N micro-tests from a single prompt, that decomposition is the authoritative one. Do not "merge them into 1 for simplicity," do not "rewrite them to share bootstrap," do not "collapse them to match a 4 UC / 4 TC plan." Accept what the generator gave you.
13
+
14
+ ## Limits
15
+
16
+ Anything a test must or must not touch, including which target and which path, goes in the test case's stored `description` before the run. A limit stated only in chat with the coding agent does not reach the run.
17
+
18
+ - Store it with `muggle-remote-test-case-create`, or with `muggle-remote-test-case-update` on an existing case, keeping the stored text and adding to it. When a generator wrote the draft, check that the limit survived into its `description`.
19
+ - Every run reads the stored text: local and cloud, generation, regeneration and replay. Text given for one run adds to it and never replaces it.
20
+ - A use case edit that really changes `title`, `description` or `url`, and every `muggle-remote-use-case-update-from-prompt` call, replaces the use case's test cases and drops their limits. Store them again afterwards.
@@ -122,7 +122,7 @@ Create what the scope planned, before any run:
122
122
 
123
123
  1. **New use cases** — one `muggle-remote-use-case-create-from-prompts` call with every `newUseCases` instruction in its `instructions` array. Map each created use case back to its key.
124
124
  2. **New test cases** — one `muggle-remote-test-case-generate-from-prompt` per `newTestCases` entry, all in one message, with `projectId`, the resolved `useCaseId`, and the entry's `instruction`.
125
- 3. **Create every generated case** — `muggle-remote-test-case-create` for each, in parallel. Accept the generator's decomposition as-is ([`../_shared/test-case-design.md`](../_shared/test-case-design.md)): N micro-tests from one instruction are N test cases. Record each `testCaseId` against its key; the report and a Stage 7.5 re-run name new cases by id.
125
+ 3. **Create every generated case** — `muggle-remote-test-case-create` for each, in parallel. Accept the generator's decomposition as-is ([`../_shared/test-case-design.md`](../_shared/test-case-design.md)): N micro-tests from one instruction are N test cases. Anything the request says a case must or must not touch goes in that case's `description` ([limits](../_shared/test-case-design.md#limits)); add it if the generator's draft dropped it. Record each `testCaseId` against its key; the report and a Stage 7.5 re-run name new cases by id.
126
126
 
127
127
  A failed create leaves its entry `INCONCLUSIVE` with reason `case creation failed: <error>`; it stays in the report.
128
128
 
@@ -108,6 +108,8 @@ Do not proceed further.
108
108
 
109
109
  2. Load and call `muggle-remote-action-script-get` with `actionScriptId`.
110
110
 
111
+ 3. Load and call `muggle-remote-test-case-get` with the test case ID from Step 4. Keep its `description`.
112
+
111
113
  Tell the user: `Executing task...`
112
114
 
113
115
  ## Step 7 — Execute locally
@@ -115,6 +117,7 @@ Tell the user: `Executing task...`
115
117
  Load and call `muggle-local-execute-replay` with:
116
118
  - `testScript`: the full object from Step 6 (from `muggle-remote-test-script-get`)
117
119
  - `actionScript`: the content from Step 6 (from `muggle-remote-action-script-get`)
120
+ - `testCaseDescription`: the `description` from Step 6 (from `muggle-remote-test-case-get`)
118
121
  - `localUrl`: from Step 1
119
122
  - `mutations`: the `mutations[]` array from Step 1 (omit if empty)
120
123
 
@@ -42,7 +42,7 @@ Reach for these when the user is weighing Muggle Test against hand-written specs
42
42
 
43
43
  ## Test Case Design: One Atomic Behavior Per Test Case
44
44
 
45
- Every test case verifies exactly **one** user-observable behavior, carries no signup, login, navigation, or seed-data steps, and the generator's decomposition is kept as-is. The full rule, with examples: [`_shared/test-case-design.md`](../_shared/test-case-design.md).
45
+ Every test case verifies exactly **one** user-observable behavior, carries no signup, login, navigation, or seed-data steps, and the generator's decomposition is kept as-is. The full rule, with examples: [`_shared/test-case-design.md`](../_shared/test-case-design.md). Anything the user said a test must or must not touch, including which target and which path, goes in its stored `description` before the run ([limits](../_shared/test-case-design.md#limits)); stated only in this chat, it does not reach the run.
46
46
 
47
47
  **Never skip the generate→review cycle.** Even when you are 100% confident about the right shape, always present the generated test cases to the user before calling `muggle-remote-test-case-create`. "I'll skip the generate→review cycle and create directly" is a sign you're about to get it wrong.
48
48
 
@@ -25,7 +25,7 @@ Branch each test case on its `mode`, then issue **all** workflow-start calls in
25
25
  - `url`: The preview/staging URL
26
26
  - `goal`: From the test case
27
27
  - `precondition`: From the test case (use `"None"` if empty)
28
- - `instructions`: From the test case
28
+ - `instructions`: The test case's `description`, plus anything specific to this run. The stored `description` always reaches the run, so a limit belongs there ([limits](../_shared/test-case-design.md#limits)).
29
29
  - `expectedResult`: From the test case
30
30
 
31
31
  **Replay-mode test case** — `muggle-remote-workflow-start-test-script-replay` against the latest replayable script for that test case (resolve via `muggle-remote-test-script-list` with `runEnvironmentType: "remote"` if not already in hand from the classification step). Tag results with `mode: "replay"` so the router routes failures correctly.
@@ -109,6 +109,7 @@ Prompt for projects: "Pick the project to group this test into:"
109
109
  - **Test case — Create new test case** (requires a chosen `useCaseId`): User provides an instruction describing what to test.
110
110
  1. `muggle-remote-test-case-generate-from-prompt` with `projectId`, `useCaseId`, `instruction` — **preview only** (server test-case prompt preview); show the returned draft(s); get confirmation via `AskUserQuestion`.
111
111
  2. Persist the accepted draft with `muggle-remote-test-case-create`, mapping preview fields into the required properties (`title`, `description`, `goal`, `expectedResult`, `url`, etc.). Then continue from **section 5** with that `testCaseId`.
112
+ - **Limits:** anything the user said the test must or must not touch, including which target and which path, goes in the chosen test case's stored `description` before the run, on a new case or an existing one ([limits](../_shared/test-case-design.md#limits)). Stated only in this chat, it does not reach the run.
112
113
 
113
114
  ### 3. Ensure Local Services Are Ready
114
115
 
@@ -343,6 +343,8 @@ For each use case, run a bulk-preview job to generate its test cases.
343
343
  url: <from testCase.url>
344
344
  ```
345
345
 
346
+ Anything the source says a test must or must not touch stays in `description`; add it if the preview dropped it ([limits](../_shared/test-case-design.md#limits)).
347
+
346
348
  Print progress: `Creating test cases for "User Authentication"... (1/3)`
347
349
 
348
350
  It is safe to create test cases for different use cases in parallel once their bulk-preview
@@ -146,7 +146,7 @@ Send a single bulk request instead of dispatching one workflow per test case:
146
146
  - `projectId` — from Step 2
147
147
  - `name` — `"muggle-test-regenerate-missing: bulk ({count} test cases)"` where `{count}` is the number of selected test cases
148
148
  - `testCaseIds` — array of all selected test case IDs from Step 5
149
- 2. The backend handles looking up full test case details (goal, precondition, instructions, expectedResult, url), so there is no need to call `muggle-remote-test-case-get` per test case.
149
+ 2. The backend handles looking up full test case details (goal, precondition, description, expectedResult, url), so there is no need to call `muggle-remote-test-case-get` per test case.
150
150
  3. Parse the response to get the `items` array with per-test-case status. Each item contains the test case ID, dispatch status, and (when successful) the workflow runtime ID.
151
151
 
152
152
  **Failure handling:** the bulk API returns per-item status in the response `items` array. Individual test cases may fail (validation error, missing field, etc.) while others succeed. Surface failures in the Step 7 report — partial progress beats no progress.